diff --git a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml index db3789c74a934..4e3e273ce58ce 100755 --- a/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml +++ b/eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml @@ -318,7 +318,8 @@ the main ServiceBusClientBuilder. --> - + + diff --git a/eng/common/pipelines/templates/steps/validate-all-packages.yml b/eng/common/pipelines/templates/steps/validate-all-packages.yml new file mode 100644 index 0000000000000..db374478a06a1 --- /dev/null +++ b/eng/common/pipelines/templates/steps/validate-all-packages.yml @@ -0,0 +1,34 @@ +parameters: + ArtifactPath: $(Build.ArtifactStagingDirectory) + Artifacts: [] + ConfigFileDir: $(Build.ArtifactStagingDirectory)/PackageInfo + +steps: + - ${{ if and(ne(variables['Skip.PackageValidation'], 'true'), eq(variables['System.TeamProject'], 'internal')) }}: + - pwsh: | + echo "##vso[task.setvariable variable=SetAsReleaseBuild]false" + displayName: "Set as release build" + condition: and(succeeded(), eq(variables['SetAsReleaseBuild'], '')) + + - task: Powershell@2 + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/scripts/Validate-All-Packages.ps1 + arguments: > + -ArtifactList ('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object Name) + -ArtifactPath ${{ parameters.ArtifactPath }} + -RepoRoot $(Build.SourcesDirectory) + -APIKey $(azuresdk-apiview-apikey) + -ConfigFileDir '${{ parameters.ConfigFileDir }}' + -BuildDefinition $(System.CollectionUri)$(System.TeamProject)/_build?definitionId=$(System.DefinitionId) + -PipelineUrl $(System.CollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId) + -Devops_pat '$(azuresdk-azure-sdk-devops-release-work-item-pat)' + -IsReleaseBuild $$(SetAsReleaseBuild) + pwsh: true + workingDirectory: $(Pipeline.Workspace) + displayName: Validate packages and update work items + continueOnError: true + condition: >- + and( + succeededOrFailed(), + not(endsWith(variables['Build.Repository.Name'], '-pr')) + ) diff --git a/eng/common/scripts/ChangeLog-Operations.ps1 b/eng/common/scripts/ChangeLog-Operations.ps1 index e31d10dc87184..fb5f85c9a49fc 100644 --- a/eng/common/scripts/ChangeLog-Operations.ps1 +++ b/eng/common/scripts/ChangeLog-Operations.ps1 @@ -138,14 +138,27 @@ function Confirm-ChangeLogEntry { [Parameter(Mandatory = $true)] [String]$VersionString, [boolean]$ForRelease = $false, - [Switch]$SantizeEntry + [Switch]$SantizeEntry, + [PSCustomObject]$ChangeLogStatus = $null ) + if (!$ChangeLogStatus) { + $ChangeLogStatus = [PSCustomObject]@{ + IsValid = $false + Message = "" + } + } + else { + # Do not stop the script on error when status object is passed as param + $ErrorActionPreference = 'Continue' + } $changeLogEntries = Get-ChangeLogEntries -ChangeLogLocation $ChangeLogLocation $changeLogEntry = $changeLogEntries[$VersionString] if (!$changeLogEntry) { - LogError "ChangeLog[${ChangeLogLocation}] does not have an entry for version ${VersionString}." + $ChangeLogStatus.Message = "ChangeLog[${ChangeLogLocation}] does not have an entry for version ${VersionString}." + $ChangeLogStatus.IsValid = $false + LogError "$($ChangeLogStatus.Message)" return $false } @@ -161,14 +174,16 @@ function Confirm-ChangeLogEntry { Write-Host "-----" if ([System.String]::IsNullOrEmpty($changeLogEntry.ReleaseStatus)) { - LogError "Entry does not have a correct release status. Please ensure the status is set to a date '($CHANGELOG_DATE_FORMAT)' or '$CHANGELOG_UNRELEASED_STATUS' if not yet released. See https://aka.ms/azsdk/guideline/changelogs for more info." + $ChangeLogStatus.Message = "Entry does not have a release status. Please ensure the status is set to a date '($CHANGELOG_DATE_FORMAT)' or '$CHANGELOG_UNRELEASED_STATUS' if not yet released. See https://aka.ms/azsdk/guideline/changelogs for more info." + $ChangeLogStatus.IsValid = $false + LogError "$($ChangeLogStatus.Message)" return $false } if ($ForRelease -eq $True) { LogDebug "Verifying as a release build because ForRelease parameter is set to true" - return Confirm-ChangeLogForRelease -changeLogEntry $changeLogEntry -changeLogEntries $changeLogEntries + return Confirm-ChangeLogForRelease -changeLogEntry $changeLogEntry -changeLogEntries $changeLogEntries -ChangeLogStatus $ChangeLogStatus } # If the release status is a valid date then verify like its about to be released @@ -176,9 +191,11 @@ function Confirm-ChangeLogEntry { if ($status -as [DateTime]) { LogDebug "Verifying as a release build because the changelog entry has a valid date." - return Confirm-ChangeLogForRelease -changeLogEntry $changeLogEntry -changeLogEntries $changeLogEntries + return Confirm-ChangeLogForRelease -changeLogEntry $changeLogEntry -changeLogEntries $changeLogEntries -ChangeLogStatus $ChangeLogStatus } + $ChangeLogStatus.Message = "ChangeLog[${ChangeLogLocation}] has an entry for version ${VersionString}." + $ChangeLogStatus.IsValid = $true return $true } @@ -338,15 +355,23 @@ function Confirm-ChangeLogForRelease { [Parameter(Mandatory = $true)] $changeLogEntry, [Parameter(Mandatory = $true)] - $changeLogEntries + $changeLogEntries, + $ChangeLogStatus = $null ) + if (!$ChangeLogStatus) { + $ChangeLogStatus = [PSCustomObject]@{ + IsValid = $false + Message = "" + } + } $entries = Sort-ChangeLogEntries -changeLogEntries $changeLogEntries - $isValid = $true + $ChangeLogStatus.IsValid = $true if ($changeLogEntry.ReleaseStatus -eq $CHANGELOG_UNRELEASED_STATUS) { - LogError "Entry has no release date set. Please ensure to set a release date with format '$CHANGELOG_DATE_FORMAT'. See https://aka.ms/azsdk/guideline/changelogs for more info." - $isValid = $false + $ChangeLogStatus.Message = "Entry has no release date set. Please ensure to set a release date with format '$CHANGELOG_DATE_FORMAT'. See https://aka.ms/azsdk/guideline/changelogs for more info." + $ChangeLogStatus.IsValid = $false + LogError "$($ChangeLogStatus.Message)" } else { $status = $changeLogEntry.ReleaseStatus.Trim().Trim("()") @@ -354,25 +379,29 @@ function Confirm-ChangeLogForRelease { $releaseDate = [DateTime]$status if ($status -ne ($releaseDate.ToString($CHANGELOG_DATE_FORMAT))) { - LogError "Date must be in the format $($CHANGELOG_DATE_FORMAT). See https://aka.ms/azsdk/guideline/changelogs for more info." - $isValid = $false + $ChangeLogStatus.Message = "Date must be in the format $($CHANGELOG_DATE_FORMAT). See https://aka.ms/azsdk/guideline/changelogs for more info." + $ChangeLogStatus.IsValid = $false + LogError "$($ChangeLogStatus.Message)" } if (@($entries.ReleaseStatus)[0] -ne $changeLogEntry.ReleaseStatus) { - LogError "Invalid date [ $status ]. The date for the changelog being released must be the latest in the file." - $isValid = $false + $ChangeLogStatus.Message = "Invalid date [ $status ]. The date for the changelog being released must be the latest in the file." + $ChangeLogStatus.IsValid = $false + LogError "$($ChangeLogStatus.Message)" } } catch { - LogError "Invalid date [ $status ] passed as status for Version [$($changeLogEntry.ReleaseVersion)]. See https://aka.ms/azsdk/guideline/changelogs for more info." - $isValid = $false + $ChangeLogStatus.Message = "Invalid date [ $status ] passed as status for Version [$($changeLogEntry.ReleaseVersion)]. See https://aka.ms/azsdk/guideline/changelogs for more info." + $ChangeLogStatus.IsValid = $false + LogError "$($ChangeLogStatus.Message)" } } if ([System.String]::IsNullOrWhiteSpace($changeLogEntry.ReleaseContent)) { - LogError "Entry has no content. Please ensure to provide some content of what changed in this version. See https://aka.ms/azsdk/guideline/changelogs for more info." - $isValid = $false + $ChangeLogStatus.Message = "Entry has no content. Please ensure to provide some content of what changed in this version. See https://aka.ms/azsdk/guideline/changelogs for more info." + $ChangeLogStatus.IsValid = $false + LogError "$($ChangeLogStatus.Message)" } $foundRecommendedSection = $false @@ -391,12 +420,14 @@ function Confirm-ChangeLogForRelease { } if ($emptySections.Count -gt 0) { - LogError "The changelog entry has the following sections with no content ($($emptySections -join ', ')). Please ensure to either remove the empty sections or add content to the section." - $isValid = $false + $ChangeLogStatus.Message = "The changelog entry has the following sections with no content ($($emptySections -join ', ')). Please ensure to either remove the empty sections or add content to the section." + $ChangeLogStatus.IsValid = $false + LogError "$($ChangeLogStatus.Message)" } if (!$foundRecommendedSection) { - LogWarning "The changelog entry did not contain any of the recommended sections ($($RecommendedSectionHeaders -join ', ')), please add at least one. See https://aka.ms/azsdk/guideline/changelogs for more info." + $ChangeLogStatus.Message = "The changelog entry did not contain any of the recommended sections ($($RecommendedSectionHeaders -join ', ')), please add at least one. See https://aka.ms/azsdk/guideline/changelogs for more info." + LogWarning "$($ChangeLogStatus.Message)" } - return $isValid + return $ChangeLogStatus.IsValid } \ No newline at end of file diff --git a/eng/common/scripts/Helpers/ApiView-Helpers.ps1 b/eng/common/scripts/Helpers/ApiView-Helpers.ps1 index bf8b16a99e021..58ee8ee19ca1c 100644 --- a/eng/common/scripts/Helpers/ApiView-Helpers.ps1 +++ b/eng/common/scripts/Helpers/ApiView-Helpers.ps1 @@ -1,4 +1,4 @@ -function MapLanguageName($language) +function MapLanguageToRequestParam($language) { $lang = $language # Update language name to match those in API cosmos DB. Cosmos SQL is case sensitive and handling this within the query makes it slow. @@ -6,7 +6,7 @@ function MapLanguageName($language) $lang = "JavaScript" } elseif ($lang -eq "dotnet"){ - $lang = "C#" + $lang = "C%23" } elseif ($lang -eq "java"){ $lang = "Java" @@ -23,17 +23,12 @@ function MapLanguageName($language) function Check-ApiReviewStatus($packageName, $packageVersion, $language, $url, $apiKey, $apiApprovalStatus = $null, $packageNameStatus = $null) { # Get API view URL and API Key to check status - Write-Host "Checking API review status" - $lang = MapLanguageName -language $language + Write-Host "Checking API review status for package: ${packageName}" + $lang = MapLanguageToRequestParam -language $language if ($lang -eq $null) { return } $headers = @{ "ApiKey" = $apiKey } - $body = @{ - language = $lang - packageName = $packageName - packageVersion = $packageVersion - } if (!$apiApprovalStatus) { $apiApprovalStatus = [PSCustomObject]@{ @@ -51,7 +46,10 @@ function Check-ApiReviewStatus($packageName, $packageVersion, $language, $url, $ try { - $response = Invoke-WebRequest $url -Method 'GET' -Headers $headers -Body $body + $requestUrl = "${url}?language=${lang}&packageName=${packageName}&packageVersion=${packageVersion}" + Write-Host "Request to APIView: [${requestUrl}]" + $response = Invoke-WebRequest $requestUrl -Method 'GET' -Headers $headers + Write-Host "Response: $($response.StatusCode)" Process-ReviewStatusCode -statusCode $response.StatusCode -packageName $packageName -apiApprovalStatus $apiApprovalStatus -packageNameStatus $packageNameStatus if ($apiApprovalStatus.IsApproved) { Write-Host $($apiApprovalStatus.Details) diff --git a/eng/common/scripts/Helpers/DevOps-WorkItem-Helpers.ps1 b/eng/common/scripts/Helpers/DevOps-WorkItem-Helpers.ps1 index c03b6693edd41..805486245c5cc 100644 --- a/eng/common/scripts/Helpers/DevOps-WorkItem-Helpers.ps1 +++ b/eng/common/scripts/Helpers/DevOps-WorkItem-Helpers.ps1 @@ -985,4 +985,46 @@ function UpdatePackageVersions($pkgWorkItem, $plannedVersions, $shippedVersions) -Uri "https://dev.azure.com/azure-sdk/_apis/wit/workitems/${id}?api-version=6.0" ` -Headers (Get-DevOpsRestHeaders) -Body $body -ContentType "application/json-patch+json" | ConvertTo-Json -Depth 10 | ConvertFrom-Json -AsHashTable return $response +} + +function UpdateValidationStatus($pkgvalidationDetails, $BuildDefinition, $PipelineUrl) +{ + $pkgName = $pkgValidationDetails.Name + $versionString = $pkgValidationDetails.Version + + $parsedNewVersion = [AzureEngSemanticVersion]::new($versionString) + $versionMajorMinor = "" + $parsedNewVersion.Major + "." + $parsedNewVersion.Minor + $workItem = FindPackageWorkItem -lang $LanguageDisplayName -packageName $pkgName -version $versionMajorMinor -includeClosed $true -outputCommand $false + + if (!$workItem) + { + Write-Host"No work item found for package [$pkgName]." + return $false + } + + $changeLogStatus = $pkgValidationDetails.ChangeLogValidation.Status + $changeLogDetails = $pkgValidationDetails.ChangeLogValidation.Message + $apiReviewStatus = $pkgValidationDetails.APIReviewValidation.Status + $apiReviewDetails = $pkgValidationDetails.APIReviewValidation.Message + $packageNameStatus = $pkgValidationDetails.PackageNameValidation.Status + $packageNameDetails = $pkgValidationDetails.PackageNameValidation.Message + + $fields = @() + $fields += "`"PackageVersion=${versionString}`"" + $fields += "`"ChangeLogStatus=${changeLogStatus}`"" + $fields += "`"ChangeLogValidationDetails=${changeLogDetails}`"" + $fields += "`"APIReviewStatus=${apiReviewStatus}`"" + $fields += "`"APIReviewStatusDetails=${apiReviewDetails}`"" + $fields += "`"PackageNameApprovalStatus=${packageNameStatus}`"" + $fields += "`"PackageNameApprovalDetails=${packageNameDetails}`"" + if ($BuildDefinition) { + $fields += "`"PipelineDefinition=$BuildDefinition`"" + } + if ($PipelineUrl) { + $fields += "`"LatestPipelineRun=$PipelineUrl`"" + } + + $workItem = UpdateWorkItem -id $workItem.id -fields $fields + Write-Host "[$($workItem.id)]$LanguageDisplayName - $pkgName($versionMajorMinor) - Updated" + return $true } \ No newline at end of file diff --git a/eng/common/scripts/Update-DevOps-Release-WorkItem.ps1 b/eng/common/scripts/Update-DevOps-Release-WorkItem.ps1 index c8ac48e4fa868..b3a0da8036bf0 100644 --- a/eng/common/scripts/Update-DevOps-Release-WorkItem.ps1 +++ b/eng/common/scripts/Update-DevOps-Release-WorkItem.ps1 @@ -15,7 +15,8 @@ param( [string]$packageNewLibrary = "true", [string]$relatedWorkItemId = $null, [string]$tag = $null, - [string]$devops_pat = $env:DEVOPS_PAT + [string]$devops_pat = $env:DEVOPS_PAT, + [bool]$inRelease = $true ) #Requires -Version 6.0 Set-StrictMode -Version 3 @@ -97,8 +98,11 @@ Write-Host " PackageDisplayName: $($workItem.fields['Custom.PackageDisplayName' Write-Host " ServiceName: $($workItem.fields['Custom.ServiceName'])" Write-Host " PackageType: $($workItem.fields['Custom.PackageType'])" Write-Host "" -Write-Host "Marking item [$($workItem.id)]$($workItem.fields['System.Title']) as '$state' for '$releaseType'" -$updatedWI = UpdatePackageWorkItemReleaseState -id $workItem.id -state "In Release" -releaseType $releaseType -outputCommand $false +if ($inRelease) +{ + Write-Host "Marking item [$($workItem.id)]$($workItem.fields['System.Title']) as '$state' for '$releaseType'" + $updatedWI = UpdatePackageWorkItemReleaseState -id $workItem.id -state "In Release" -releaseType $releaseType -outputCommand $false +} $updatedWI = UpdatePackageVersions $workItem -plannedVersions $plannedVersions Write-Host "Release tracking item is at https://dev.azure.com/azure-sdk/Release/_workitems/edit/$($updatedWI.id)/" diff --git a/eng/common/scripts/Validate-All-Packages.ps1 b/eng/common/scripts/Validate-All-Packages.ps1 new file mode 100644 index 0000000000000..46d76195ba143 --- /dev/null +++ b/eng/common/scripts/Validate-All-Packages.ps1 @@ -0,0 +1,52 @@ +[CmdletBinding()] +Param ( + [Parameter(Mandatory=$True)] + [array]$ArtifactList, + [Parameter(Mandatory=$True)] + [string]$ArtifactPath, + [Parameter(Mandatory=$True)] + [string]$RepoRoot, + [Parameter(Mandatory=$True)] + [string]$APIKey, + [string]$ConfigFileDir, + [string]$BuildDefinition, + [string]$PipelineUrl, + [string]$APIViewUri = "https://apiview.dev/AutoReview/GetReviewStatus", + [string]$Devops_pat = $env:DEVOPS_PAT, + [bool] $IsReleaseBuild = $false +) + +Set-StrictMode -Version 3 +. (Join-Path $PSScriptRoot common.ps1) + +function ProcessPackage($PackageName, $ConfigFileDir) +{ + Write-Host "Artifact path: $($ArtifactPath)" + Write-Host "Package Name: $($PackageName)" + Write-Host "Config File directory: $($ConfigFileDir)" + + &$EngCommonScriptsDir/Validate-Package.ps1 ` + -PackageName $PackageName ` + -ArtifactPath $ArtifactPath ` + -RepoRoot $RepoRoot ` + -APIViewUri $APIViewUri ` + -APIKey $APIKey ` + -BuildDefinition $BuildDefinition ` + -PipelineUrl $PipelineUrl ` + -ConfigFileDir $ConfigFileDir ` + -Devops_pat $Devops_pat + if ($LASTEXITCODE -ne 0) { + Write-Error "Failed to validate package $PackageName" + exit 1 + } +} + +# Check if package config file is present. This file has package version, SDK type etc info. +if (-not $ConfigFileDir) { + $ConfigFileDir = Join-Path -Path $ArtifactPath "PackageInfo" +} +foreach ($artifact in $ArtifactList) +{ + Write-Host "Processing $($artifact.name)" + ProcessPackage -PackageName $artifact.name -ConfigFileDir $ConfigFileDir +} \ No newline at end of file diff --git a/eng/common/scripts/Validate-Package.ps1 b/eng/common/scripts/Validate-Package.ps1 new file mode 100644 index 0000000000000..57f093d76e695 --- /dev/null +++ b/eng/common/scripts/Validate-Package.ps1 @@ -0,0 +1,252 @@ +#This script is responsible for release preparedness check that's run as part of build pipeline. + +[CmdletBinding()] +param ( + [Parameter(Mandatory = $true)] + [string] $PackageName, + [Parameter(Mandatory = $true)] + [string] $ArtifactPath, + [Parameter(Mandatory=$True)] + [string] $RepoRoot, + [Parameter(Mandatory=$True)] + [string] $APIKey, + [Parameter(Mandatory=$True)] + [string] $ConfigFileDir, + [string] $BuildDefinition, + [string] $PipelineUrl, + [string] $APIViewUri, + [string] $Devops_pat = $env:DEVOPS_PAT, + [bool] $IsReleaseBuild = $false +) +Set-StrictMode -Version 3 + +. (Join-Path $PSScriptRoot common.ps1) +. ${PSScriptRoot}\Helpers\ApiView-Helpers.ps1 +. ${PSScriptRoot}\Helpers\DevOps-WorkItem-Helpers.ps1 + +if (!$Devops_pat) { + az account show *> $null + if (!$?) { + Write-Host 'Running az login...' + az login *> $null + } +} +else { + # Login using PAT + LoginToAzureDevops $Devops_pat +} + +az extension show -n azure-devops *> $null +if (!$?){ + az extension add --name azure-devops +} else { + # Force update the extension to the latest version if it was already installed + # this is needed to ensure we have the authentication issue fixed from earlier versions + az extension update -n azure-devops *> $null +} + +CheckDevOpsAccess + +# Function to validate change log +function ValidateChangeLog($changeLogPath, $versionString, $validationStatus) +{ + try + { + $ChangeLogStatus = [PSCustomObject]@{ + IsValid = $false + Message = "" + } + $changeLogFullPath = Join-Path $RepoRoot $changeLogPath + Write-Host "Path to change log: [$changeLogFullPath]" + if (Test-Path $changeLogFullPath) + { + Confirm-ChangeLogEntry -ChangeLogLocation $changeLogFullPath -VersionString $versionString -ForRelease $true -ChangeLogStatus $ChangeLogStatus + $validationStatus.Status = if ($ChangeLogStatus.IsValid) { "Success" } else { "Failed" } + $validationStatus.Message = $ChangeLogStatus.Message + } + else { + $validationStatus.Status = "Failed" + $validationStatus.Message = "Change log is not found in [$changeLogPath]. Change log file must be present in package root directory." + } + } + catch + { + Write-Host "Current directory: $(Get-Location)" + $validationStatus.Status = "Failed" + $validationStatus.Message = $_.Exception.Message + } +} + +# Function to verify API review status +function VerifyAPIReview($packageName, $packageVersion, $language) +{ + $APIReviewValidation = [PSCustomObject]@{ + Name = "API Review Approval" + Status = "Pending" + Message = "" + } + $PackageNameValidation = [PSCustomObject]@{ + Name = "Package Name Approval" + Status = "Pending" + Message = "" + } + + try + { + $apiStatus = [PSCustomObject]@{ + IsApproved = $false + Details = "" + } + $packageNameStatus = [PSCustomObject]@{ + IsApproved = $false + Details = "" + } + Write-Host "Checking API review status for package $packageName with version $packageVersion. language [$language]." + Check-ApiReviewStatus $packageName $packageVersion $language $APIViewUri $APIKey $apiStatus $packageNameStatus + + Write-Host "API review approval details: $($apiStatus.Details)" + Write-Host "Package name approval details: $($packageNameStatus.Details)" + #API review approval status + $APIReviewValidation.Message = $apiStatus.Details + $APIReviewValidation.Status = if ($apiStatus.IsApproved) { "Approved" } else { "Pending" } + + # Package name approval status + $PackageNameValidation.Status = if ($packageNameStatus.IsApproved) { "Approved" } else { "Pending" } + $PackageNameValidation.Message = $packageNameStatus.Details + } + catch + { + Write-Warning "Failed to get API review status. Error: $_" + $PackageNameValidation.Status = "Failed" + $PackageNameValidation.Message = $_.Exception.Message + $APIReviewValidation.Status = "Failed" + $APIReviewValidation.Message = $_.Exception.Message + } + + return [PSCustomObject]@{ + ApiviewApproval = $APIReviewValidation + PackageNameApproval = $PackageNameValidation + } +} + + +function IsVersionShipped($packageName, $packageVersion) +{ + # This function will decide if a package version is already shipped or not + Write-Host "Checking if a version is already shipped for package $packageName with version $packageVersion." + $parsedNewVersion = [AzureEngSemanticVersion]::new($packageVersion) + $versionMajorMinor = "" + $parsedNewVersion.Major + "." + $parsedNewVersion.Minor + $workItem = FindPackageWorkItem -lang $LanguageDisplayName -packageName $packageName -version $versionMajorMinor -includeClosed $true -outputCommand $false + if ($workItem) + { + # Check if the package version is already shipped + $shippedVersionSet = ParseVersionSetFromMDField $workItem.fields["Custom.ShippedPackages"] + if ($shippedVersionSet.ContainsKey($packageVersion)) { + return $true + } + } + else { + Write-Host "No work item found for package [$packageName]. Creating new work item for package." + } + return $false +} + +function CreateUpdatePackageWorkItem($pkgInfo) +{ + # This function will create or update package work item in Azure DevOps + $versionString = $pkgInfo.Version + $packageName = $pkgInfo.Name + $plannedDate = $pkgInfo.ReleaseStatus + $setReleaseState = $true + if (!$plannedDate -or $plannedDate -eq "Unreleased") + { + $setReleaseState = $false + $plannedDate = "unknown" + } + + # Create or update package work item + &$EngCommonScriptsDir/Update-DevOps-Release-WorkItem.ps1 ` + -language $LanguageDisplayName ` + -packageName $packageName ` + -version $versionString ` + -plannedDate $plannedDate ` + -packageRepoPath $pkgInfo.serviceDirectory ` + -packageType $pkgInfo.SDKType ` + -packageNewLibrary $pkgInfo.IsNewSDK ` + -serviceName "unknown" ` + -packageDisplayName "unknown" ` + -inRelease $IsReleaseBuild ` + -devops_pat $Devops_pat + + if ($LASTEXITCODE -ne 0) + { + Write-Host "Update of the Devops Release WorkItem failed." + return $false + } + return $true +} + +# Read package property file and identify all packages to process +Write-Host "Processing package: $PackageName" +Write-Host "Is Release Build: $IsReleaseBuild" +$packagePropertyFile = Join-Path $ConfigFileDir "$PackageName.json" +$pkgInfo = Get-Content $packagePropertyFile | ConvertFrom-Json + +$changeLogPath = $pkgInfo.ChangeLogPath +$versionString = $pkgInfo.Version +Write-Host "Checking if we need to create or update work item for package $packageName with version $versionString." +$isShipped = IsVersionShipped $packageName $versionString +if ($isShipped) { + Write-Host "Package work item already exists for version [$versionString] that is marked as shipped. Skipping the update of package work item." + exit 0 +} + +Write-Host "Validating package $packageName with version $versionString." + +# Change log validation +$changeLogStatus = [PSCustomObject]@{ + Name = "Change Log Validation" + Status = "Success" + Message = "" +} +ValidateChangeLog $changeLogPath $versionString $changeLogStatus + +# API review and package name validation +$apireviewDetails = VerifyAPIReview $PackageName $pkgInfo.Version $Language + +$pkgValidationDetails= [PSCustomObject]@{ + Name = $PackageName + Version = $pkgInfo.Version + ChangeLogValidation = $changeLogStatus + APIReviewValidation = $apireviewDetails.ApiviewApproval + PackageNameValidation = $apireviewDetails.PackageNameApproval +} + +$output = ConvertTo-Json $pkgValidationDetails +Write-Host "Output: $($output)" + +# Create json token file in artifact path +$tokenFile = Join-Path $ArtifactPath "$PackageName-Validation.json" +$output | Out-File -FilePath $tokenFile -Encoding utf8 + +# Create DevOps work item +$updatedWi = CreateUpdatePackageWorkItem $pkgInfo + +# Update validation status in package work item +if ($updatedWi) { + Write-Host "Updating validation status in package work item." + $updatedWi = UpdateValidationStatus $pkgValidationDetails $BuildDefinition $PipelineUrl +} + +# Fail the build if any validation is not successful for a release build +Write-Host "Change log status:" $changelogStatus.Status +Write-Host "API Review status:" $apireviewDetails.ApiviewApproval.Status +Write-Host "Package Name status:" $apireviewDetails.PackageNameApproval.Status + +if ($IsReleaseBuild) +{ + if (!$updatedWi -or $changelogStatus.Status -ne "Success" -or $apireviewDetails.ApiviewApproval.Status -ne "Approved" -or $apireviewDetails.PackageNameApproval.Status -ne "Approved") { + Write-Error "At least one of the Validations above failed for package $PackageName with version $versionString." + exit 1 + } +} \ No newline at end of file diff --git a/eng/pipelines/templates/jobs/ci.tests.yml b/eng/pipelines/templates/jobs/ci.tests.yml index 1ae88d231a82f..0c0d141968360 100644 --- a/eng/pipelines/templates/jobs/ci.tests.yml +++ b/eng/pipelines/templates/jobs/ci.tests.yml @@ -47,7 +47,7 @@ parameters: default: 60 jobs: - - job: + - job: Test_${{ parameters.OSName }} displayName: 'Test' dependsOn: - ${{ parameters.DependsOn }} diff --git a/eng/pipelines/templates/jobs/live.tests.yml b/eng/pipelines/templates/jobs/live.tests.yml index d7c9009131b16..3bea1efd0ad05 100644 --- a/eng/pipelines/templates/jobs/live.tests.yml +++ b/eng/pipelines/templates/jobs/live.tests.yml @@ -24,7 +24,7 @@ parameters: OSName: jobs: - - job: + - job: LiveTest_${{ parameters.OSName }} dependsOn: ${{ parameters.DependsOn }} condition: and(succeededOrFailed(), ne(${{ parameters.Matrix }}, '{}')) strategy: diff --git a/eng/pipelines/templates/jobs/native.live.tests.yml b/eng/pipelines/templates/jobs/native.live.tests.yml index 1660e94d174ed..ba36bebeb0407 100644 --- a/eng/pipelines/templates/jobs/native.live.tests.yml +++ b/eng/pipelines/templates/jobs/native.live.tests.yml @@ -66,7 +66,7 @@ parameters: type: string jobs: - - job: + - job: NativeLiveTest_${{ parameters.OSName }} dependsOn: ${{ parameters.DependsOn }} condition: and(succeededOrFailed(), ne(${{ parameters.Matrix }}, '{}')) strategy: diff --git a/eng/pipelines/templates/stages/platform-matrix.json b/eng/pipelines/templates/stages/platform-matrix.json index 672b982e45c24..d89661584da18 100644 --- a/eng/pipelines/templates/stages/platform-matrix.json +++ b/eng/pipelines/templates/stages/platform-matrix.json @@ -67,13 +67,17 @@ "TestOptions": "" }, { - "Agent": { "ubuntu-20.04": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } }, + "Agent": { + "ubuntu-20.04": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } + }, "JavaTestVersion": "1.17", "AZURE_TEST_HTTP_CLIENTS": "JdkHttpClientProvider", "TestFromSource": false }, { - "Agent": { "ubuntu-20.04": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } }, + "Agent": { + "ubuntu-20.04": { "OSVmImage": "env:LINUXVMIMAGE", "Pool": "env:LINUXPOOL" } + }, "JavaTestVersion": "1.17", "AZURE_TEST_HTTP_CLIENTS": "VertxAsyncHttpClientProvider", "TestFromSource": false diff --git a/eng/versioning/external_dependencies.txt b/eng/versioning/external_dependencies.txt index 183fb2585631f..e879fca40aafd 100644 --- a/eng/versioning/external_dependencies.txt +++ b/eng/versioning/external_dependencies.txt @@ -394,6 +394,7 @@ cosmos_org.scalastyle:scalastyle-maven-plugin;1.0.0 ## Cosmos Kafka connector under sdk\cosmos\azure-cosmos-kafka-connect\pom.xml # Cosmos Kafka connector runtime dependencies cosmos_org.apache.kafka:connect-api;3.6.0 +cosmos_com.jayway.jsonpath:json-path;2.9.0 # Cosmos Kafka connector tests only cosmos_org.apache.kafka:connect-runtime;3.6.0 cosmos_org.testcontainers:testcontainers;1.19.5 diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 4b793ee964b19..7d37d107cba70 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -109,7 +109,7 @@ com.azure.cosmos.spark:azure-cosmos-spark_3-1_2-12;4.28.4;4.29.0-beta.1 com.azure.cosmos.spark:azure-cosmos-spark_3-2_2-12;4.28.4;4.29.0-beta.1 com.azure.cosmos.spark:azure-cosmos-spark_3-3_2-12;4.28.4;4.29.0-beta.1 com.azure.cosmos.spark:azure-cosmos-spark_3-4_2-12;4.28.4;4.29.0-beta.1 -com.azure:azure-cosmos-encryption;2.8.0;2.9.0 +com.azure:azure-cosmos-encryption;2.9.0;2.10.0-beta.1 com.azure:azure-cosmos-test;1.0.0-beta.6;1.0.0-beta.7 com.azure:azure-cosmos-tests;1.0.0-beta.1;1.0.0-beta.1 com.azure.cosmos.kafka:azure-cosmos-kafka-connect;1.0.0-beta.1;1.0.0-beta.1 @@ -165,7 +165,7 @@ com.azure:azure-mixedreality-remoterendering;1.1.27;1.2.0-beta.1 com.azure:azure-monitor-opentelemetry-exporter;1.0.0-beta.21;1.0.0-beta.22 com.azure:azure-monitor-ingestion;1.1.5;1.2.0-beta.1 com.azure:azure-monitor-ingestion-perf;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-monitor-query;1.2.10;1.3.0-beta.3 +com.azure:azure-monitor-query;1.3.0;1.4.0-beta.1 com.azure:azure-monitor-query-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-perf-test-parent;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-quantum-jobs;1.0.0-beta.1;1.0.0-beta.2 @@ -183,7 +183,7 @@ com.azure:azure-security-keyvault-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-sdk-template;1.1.1234;1.2.2-beta.1 com.azure:azure-sdk-template-two;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-sdk-template-three;1.0.0-beta.1;1.0.0-beta.1 -com.azure:azure-spring-data-cosmos;3.43.0;3.44.0-beta.1 +com.azure:azure-spring-data-cosmos;3.44.0;3.45.0-beta.1 com.azure:azure-storage-blob;12.25.3;12.26.0-beta.1 com.azure:azure-storage-blob-batch;12.21.3;12.22.0-beta.1 com.azure:azure-storage-blob-changefeed;12.0.0-beta.19;12.0.0-beta.20 @@ -203,58 +203,58 @@ com.azure:perf-test-core;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-ai-vision-imageanalysis;1.0.0-beta.2;1.0.0-beta.3 com.azure.spring:azure-monitor-spring-native;1.0.0-beta.1;1.0.0-beta.1 com.azure.spring:azure-monitor-spring-native-test;1.0.0-beta.1;1.0.0-beta.1 -com.azure.spring:spring-cloud-azure-appconfiguration-config-web;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-appconfiguration-config;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-feature-management-web;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-feature-management;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-appconfiguration-config;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-dependencies;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-messaging-azure;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-messaging-azure-eventhubs;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-messaging-azure-servicebus;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-messaging-azure-storage-queue;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-integration-azure-core;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-integration-azure-eventhubs;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-integration-azure-servicebus;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-integration-azure-storage-queue;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-core;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-actuator-autoconfigure;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-actuator;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-autoconfigure;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-resourcemanager;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-service;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-active-directory;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-active-directory-b2c;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-actuator;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-appconfiguration;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-cosmos;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-data-cosmos;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-eventhubs;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-eventgrid;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-jdbc-mysql;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-jdbc-postgresql;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-redis;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-keyvault;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-keyvault-certificates;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-keyvault-secrets;4.16.0;4.17.0-beta.1 +com.azure.spring:spring-cloud-azure-appconfiguration-config-web;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-appconfiguration-config;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-feature-management-web;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-feature-management;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-appconfiguration-config;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-dependencies;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-messaging-azure;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-messaging-azure-eventhubs;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-messaging-azure-servicebus;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-messaging-azure-storage-queue;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-integration-azure-core;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-integration-azure-eventhubs;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-integration-azure-servicebus;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-integration-azure-storage-queue;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-core;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-actuator-autoconfigure;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-actuator;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-autoconfigure;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-resourcemanager;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-service;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-active-directory;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-active-directory-b2c;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-actuator;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-appconfiguration;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-cosmos;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-data-cosmos;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-eventhubs;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-eventgrid;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-jdbc-mysql;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-jdbc-postgresql;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-redis;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-keyvault;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-keyvault-certificates;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-keyvault-secrets;4.17.0;4.18.0-beta.1 com.azure.spring:spring-cloud-azure-starter-monitor;1.0.0-beta.4;1.0.0-beta.5 -com.azure.spring:spring-cloud-azure-starter-servicebus-jms;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-servicebus;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-storage;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-storage-blob;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-storage-file-share;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-storage-queue;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-integration-eventhubs;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-integration-servicebus;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-integration-storage-queue;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-stream-eventhubs;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter-stream-servicebus;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-starter;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-stream-binder-eventhubs-core;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-stream-binder-eventhubs;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-stream-binder-servicebus-core;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-stream-binder-servicebus;4.16.0;4.17.0-beta.1 -com.azure.spring:spring-cloud-azure-trace-sleuth;4.16.0;4.17.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-servicebus-jms;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-servicebus;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-storage;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-storage-blob;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-storage-file-share;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-storage-queue;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-integration-eventhubs;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-integration-servicebus;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-integration-storage-queue;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-stream-eventhubs;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter-stream-servicebus;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-starter;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-stream-binder-eventhubs-core;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-stream-binder-eventhubs;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-stream-binder-servicebus-core;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-stream-binder-servicebus;4.17.0;4.18.0-beta.1 +com.azure.spring:spring-cloud-azure-trace-sleuth;4.17.0;4.18.0-beta.1 com.azure.resourcemanager:azure-resourcemanager;2.37.0;2.38.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-appplatform;2.37.0;2.38.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-appservice;2.37.0;2.38.0-beta.1 @@ -355,7 +355,7 @@ com.azure.resourcemanager:azure-resourcemanager-marketplaceordering;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-timeseriesinsights;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-streamanalytics;1.0.0-beta.3;1.0.0-beta.4 com.azure.resourcemanager:azure-resourcemanager-operationsmanagement;1.0.0-beta.2;1.0.0-beta.3 -com.azure.resourcemanager:azure-resourcemanager-batch;1.0.0;1.1.0-beta.4 +com.azure.resourcemanager:azure-resourcemanager-batch;1.0.0;1.1.0-beta.5 com.azure.resourcemanager:azure-resourcemanager-datalakeanalytics;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-datalakestore;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-iotcentral;1.0.0;1.1.0-beta.2 @@ -435,7 +435,7 @@ com.azure.resourcemanager:azure-resourcemanager-managementgroups;1.0.0-beta.1;1. com.azure.resourcemanager:azure-resourcemanager-managednetworkfabric;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-iotfirmwaredefense;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-quantum;1.0.0-beta.2;1.0.0-beta.3 -com.azure.resourcemanager:azure-resourcemanager-sphere;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-sphere;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-chaos;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-defendereasm;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-hdinsight-containers;1.0.0-beta.1;1.0.0-beta.2 diff --git a/sdk/attestation/azure-security-attestation/pom.xml b/sdk/attestation/azure-security-attestation/pom.xml index 8b57ecce91ebc..6d876824d3292 100644 --- a/sdk/attestation/azure-security-attestation/pom.xml +++ b/sdk/attestation/azure-security-attestation/pom.xml @@ -116,6 +116,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-identity @@ -159,4 +165,21 @@ + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/batch/azure-resourcemanager-batch/CHANGELOG.md b/sdk/batch/azure-resourcemanager-batch/CHANGELOG.md index 8ce9a2ef2121a..a27735d6a0d19 100644 --- a/sdk/batch/azure-resourcemanager-batch/CHANGELOG.md +++ b/sdk/batch/azure-resourcemanager-batch/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.1.0-beta.4 (Unreleased) +## 1.1.0-beta.5 (Unreleased) ### Features Added @@ -10,6 +10,36 @@ ### Other Changes +## 1.1.0-beta.4 (2024-03-27) + +- Azure Resource Manager Batch client library for Java. This package contains Microsoft Azure SDK for Batch Management SDK. Batch Client. Package tag package-2024-02. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +### Features Added + +* `models.UpgradePolicy` was added + +* `models.RollingUpgradePolicy` was added + +* `models.UpgradeMode` was added + +* `models.AutomaticOSUpgradePolicy` was added + +#### `models.SupportedSku` was modified + +* `batchSupportEndOfLife()` was added + +#### `models.Pool$Definition` was modified + +* `withUpgradePolicy(models.UpgradePolicy)` was added + +#### `models.Pool` was modified + +* `upgradePolicy()` was added + +#### `models.Pool$Update` was modified + +* `withUpgradePolicy(models.UpgradePolicy)` was added + ## 1.1.0-beta.3 (2023-12-22) - Azure Resource Manager Batch client library for Java. This package contains Microsoft Azure SDK for Batch Management SDK. Batch Client. Package tag package-2023-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/batch/azure-resourcemanager-batch/README.md b/sdk/batch/azure-resourcemanager-batch/README.md index f908ce11a8f11..7144bd45b7cb8 100644 --- a/sdk/batch/azure-resourcemanager-batch/README.md +++ b/sdk/batch/azure-resourcemanager-batch/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Batch client library for Java. -This package contains Microsoft Azure SDK for Batch Management SDK. Batch Client. Package tag package-2023-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Batch Management SDK. Batch Client. Package tag package-2024-02. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-batch - 1.1.0-beta.3 + 1.1.0-beta.4 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/batch/azure-resourcemanager-batch/SAMPLE.md b/sdk/batch/azure-resourcemanager-batch/SAMPLE.md index 547c72d529c7b..98a2b88c9c403 100644 --- a/sdk/batch/azure-resourcemanager-batch/SAMPLE.md +++ b/sdk/batch/azure-resourcemanager-batch/SAMPLE.md @@ -81,7 +81,8 @@ */ public final class ApplicationCreateSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationCreate.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationCreate.json */ /** * Sample code: ApplicationCreate. @@ -89,7 +90,8 @@ public final class ApplicationCreateSamples { * @param manager Entry point to BatchManager. */ public static void applicationCreate(com.azure.resourcemanager.batch.BatchManager manager) { - manager.applications().define("app1").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withDisplayName("myAppName").withAllowUpdates(false).create(); + manager.applications().define("app1").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct") + .withDisplayName("myAppName").withAllowUpdates(false).create(); } } ``` @@ -102,7 +104,8 @@ public final class ApplicationCreateSamples { */ public final class ApplicationDeleteSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationDelete.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationDelete.json */ /** * Sample code: ApplicationDelete. @@ -110,7 +113,8 @@ public final class ApplicationDeleteSamples { * @param manager Entry point to BatchManager. */ public static void applicationDelete(com.azure.resourcemanager.batch.BatchManager manager) { - manager.applications().deleteWithResponse("default-azurebatch-japaneast", "sampleacct", "app1", com.azure.core.util.Context.NONE); + manager.applications().deleteWithResponse("default-azurebatch-japaneast", "sampleacct", "app1", + com.azure.core.util.Context.NONE); } } ``` @@ -123,7 +127,8 @@ public final class ApplicationDeleteSamples { */ public final class ApplicationGetSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationGet.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationGet.json */ /** * Sample code: ApplicationGet. @@ -131,7 +136,8 @@ public final class ApplicationGetSamples { * @param manager Entry point to BatchManager. */ public static void applicationGet(com.azure.resourcemanager.batch.BatchManager manager) { - manager.applications().getWithResponse("default-azurebatch-japaneast", "sampleacct", "app1", com.azure.core.util.Context.NONE); + manager.applications().getWithResponse("default-azurebatch-japaneast", "sampleacct", "app1", + com.azure.core.util.Context.NONE); } } ``` @@ -144,7 +150,8 @@ public final class ApplicationGetSamples { */ public final class ApplicationListSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationList.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationList.json */ /** * Sample code: ApplicationList. @@ -152,7 +159,8 @@ public final class ApplicationListSamples { * @param manager Entry point to BatchManager. */ public static void applicationList(com.azure.resourcemanager.batch.BatchManager manager) { - manager.applications().list("default-azurebatch-japaneast", "sampleacct", null, com.azure.core.util.Context.NONE); + manager.applications().list("default-azurebatch-japaneast", "sampleacct", null, + com.azure.core.util.Context.NONE); } } ``` @@ -167,7 +175,8 @@ import com.azure.resourcemanager.batch.models.Application; */ public final class ApplicationUpdateSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationUpdate.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationUpdate.json */ /** * Sample code: ApplicationUpdate. @@ -175,7 +184,9 @@ public final class ApplicationUpdateSamples { * @param manager Entry point to BatchManager. */ public static void applicationUpdate(com.azure.resourcemanager.batch.BatchManager manager) { - Application resource = manager.applications().getWithResponse("default-azurebatch-japaneast", "sampleacct", "app1", com.azure.core.util.Context.NONE).getValue(); + Application resource = manager.applications() + .getWithResponse("default-azurebatch-japaneast", "sampleacct", "app1", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withDisplayName("myAppName").withAllowUpdates(true).withDefaultVersion("2").apply(); } } @@ -191,7 +202,8 @@ import com.azure.resourcemanager.batch.models.ActivateApplicationPackageParamete */ public final class ApplicationPackageActivateSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationPackageActivate.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationPackageActivate.json */ /** * Sample code: ApplicationPackageActivate. @@ -199,7 +211,8 @@ public final class ApplicationPackageActivateSamples { * @param manager Entry point to BatchManager. */ public static void applicationPackageActivate(com.azure.resourcemanager.batch.BatchManager manager) { - manager.applicationPackages().activateWithResponse("default-azurebatch-japaneast", "sampleacct", "app1", "1", new ActivateApplicationPackageParameters().withFormat("zip"), com.azure.core.util.Context.NONE); + manager.applicationPackages().activateWithResponse("default-azurebatch-japaneast", "sampleacct", "app1", "1", + new ActivateApplicationPackageParameters().withFormat("zip"), com.azure.core.util.Context.NONE); } } ``` @@ -212,7 +225,8 @@ public final class ApplicationPackageActivateSamples { */ public final class ApplicationPackageCreateSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationPackageCreate.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationPackageCreate.json */ /** * Sample code: ApplicationPackageCreate. @@ -220,7 +234,8 @@ public final class ApplicationPackageCreateSamples { * @param manager Entry point to BatchManager. */ public static void applicationPackageCreate(com.azure.resourcemanager.batch.BatchManager manager) { - manager.applicationPackages().define("1").withExistingApplication("default-azurebatch-japaneast", "sampleacct", "app1").create(); + manager.applicationPackages().define("1") + .withExistingApplication("default-azurebatch-japaneast", "sampleacct", "app1").create(); } } ``` @@ -233,7 +248,8 @@ public final class ApplicationPackageCreateSamples { */ public final class ApplicationPackageDeleteSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationPackageDelete.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationPackageDelete.json */ /** * Sample code: ApplicationPackageDelete. @@ -241,7 +257,8 @@ public final class ApplicationPackageDeleteSamples { * @param manager Entry point to BatchManager. */ public static void applicationPackageDelete(com.azure.resourcemanager.batch.BatchManager manager) { - manager.applicationPackages().deleteWithResponse("default-azurebatch-japaneast", "sampleacct", "app1", "1", com.azure.core.util.Context.NONE); + manager.applicationPackages().deleteWithResponse("default-azurebatch-japaneast", "sampleacct", "app1", "1", + com.azure.core.util.Context.NONE); } } ``` @@ -254,7 +271,8 @@ public final class ApplicationPackageDeleteSamples { */ public final class ApplicationPackageGetSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationPackageGet.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationPackageGet.json */ /** * Sample code: ApplicationPackageGet. @@ -262,7 +280,8 @@ public final class ApplicationPackageGetSamples { * @param manager Entry point to BatchManager. */ public static void applicationPackageGet(com.azure.resourcemanager.batch.BatchManager manager) { - manager.applicationPackages().getWithResponse("default-azurebatch-japaneast", "sampleacct", "app1", "1", com.azure.core.util.Context.NONE); + manager.applicationPackages().getWithResponse("default-azurebatch-japaneast", "sampleacct", "app1", "1", + com.azure.core.util.Context.NONE); } } ``` @@ -275,7 +294,8 @@ public final class ApplicationPackageGetSamples { */ public final class ApplicationPackageListSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationPackageList.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationPackageList.json */ /** * Sample code: ApplicationPackageList. @@ -283,7 +303,8 @@ public final class ApplicationPackageListSamples { * @param manager Entry point to BatchManager. */ public static void applicationPackageList(com.azure.resourcemanager.batch.BatchManager manager) { - manager.applicationPackages().list("default-azurebatch-japaneast", "sampleacct", "app1", null, com.azure.core.util.Context.NONE); + manager.applicationPackages().list("default-azurebatch-japaneast", "sampleacct", "app1", null, + com.azure.core.util.Context.NONE); } } ``` @@ -300,14 +321,14 @@ import com.azure.resourcemanager.batch.models.ResourceIdentityType; import com.azure.resourcemanager.batch.models.UserAssignedIdentities; import java.util.HashMap; import java.util.Map; -import java.util.stream.Collectors; /** * Samples for BatchAccount Create. */ public final class BatchAccountCreateSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountCreate_BYOS.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_BYOS.json */ /** * Sample code: BatchAccountCreate_BYOS. @@ -315,11 +336,20 @@ public final class BatchAccountCreateSamples { * @param manager Entry point to BatchManager. */ public static void batchAccountCreateBYOS(com.azure.resourcemanager.batch.BatchManager manager) { - manager.batchAccounts().define("sampleacct").withRegion("japaneast").withExistingResourceGroup("default-azurebatch-japaneast").withAutoStorage(new AutoStorageBaseProperties().withStorageAccountId("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage")).withPoolAllocationMode(PoolAllocationMode.USER_SUBSCRIPTION).withKeyVaultReference(new KeyVaultReference().withId("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample").withUrl("http://sample.vault.azure.net/")).create(); + manager.batchAccounts().define("sampleacct").withRegion("japaneast") + .withExistingResourceGroup("default-azurebatch-japaneast") + .withAutoStorage(new AutoStorageBaseProperties().withStorageAccountId( + "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage")) + .withPoolAllocationMode(PoolAllocationMode.USER_SUBSCRIPTION) + .withKeyVaultReference(new KeyVaultReference().withId( + "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample") + .withUrl("http://sample.vault.azure.net/")) + .create(); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountCreate_UserAssignedIdentity.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ + * BatchAccountCreate_UserAssignedIdentity.json */ /** * Sample code: BatchAccountCreate_UserAssignedIdentity. @@ -327,11 +357,20 @@ public final class BatchAccountCreateSamples { * @param manager Entry point to BatchManager. */ public static void batchAccountCreateUserAssignedIdentity(com.azure.resourcemanager.batch.BatchManager manager) { - manager.batchAccounts().define("sampleacct").withRegion("japaneast").withExistingResourceGroup("default-azurebatch-japaneast").withIdentity(new BatchAccountIdentity().withType(ResourceIdentityType.USER_ASSIGNED).withUserAssignedIdentities(mapOf("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", new UserAssignedIdentities()))).withAutoStorage(new AutoStorageBaseProperties().withStorageAccountId("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage")).create(); + manager.batchAccounts().define("sampleacct").withRegion("japaneast") + .withExistingResourceGroup("default-azurebatch-japaneast") + .withIdentity(new BatchAccountIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new UserAssignedIdentities()))) + .withAutoStorage(new AutoStorageBaseProperties().withStorageAccountId( + "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage")) + .create(); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PrivateBatchAccountCreate.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateBatchAccountCreate.json */ /** * Sample code: PrivateBatchAccountCreate. @@ -339,11 +378,19 @@ public final class BatchAccountCreateSamples { * @param manager Entry point to BatchManager. */ public static void privateBatchAccountCreate(com.azure.resourcemanager.batch.BatchManager manager) { - manager.batchAccounts().define("sampleacct").withRegion("japaneast").withExistingResourceGroup("default-azurebatch-japaneast").withAutoStorage(new AutoStorageBaseProperties().withStorageAccountId("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage")).withKeyVaultReference(new KeyVaultReference().withId("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample").withUrl("http://sample.vault.azure.net/")).withPublicNetworkAccess(PublicNetworkAccessType.DISABLED).create(); + manager.batchAccounts().define("sampleacct").withRegion("japaneast") + .withExistingResourceGroup("default-azurebatch-japaneast") + .withAutoStorage(new AutoStorageBaseProperties().withStorageAccountId( + "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage")) + .withKeyVaultReference(new KeyVaultReference().withId( + "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.KeyVault/vaults/sample") + .withUrl("http://sample.vault.azure.net/")) + .withPublicNetworkAccess(PublicNetworkAccessType.DISABLED).create(); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountCreate_SystemAssignedIdentity.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ + * BatchAccountCreate_SystemAssignedIdentity.json */ /** * Sample code: BatchAccountCreate_SystemAssignedIdentity. @@ -351,11 +398,17 @@ public final class BatchAccountCreateSamples { * @param manager Entry point to BatchManager. */ public static void batchAccountCreateSystemAssignedIdentity(com.azure.resourcemanager.batch.BatchManager manager) { - manager.batchAccounts().define("sampleacct").withRegion("japaneast").withExistingResourceGroup("default-azurebatch-japaneast").withIdentity(new BatchAccountIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)).withAutoStorage(new AutoStorageBaseProperties().withStorageAccountId("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage")).create(); + manager.batchAccounts().define("sampleacct").withRegion("japaneast") + .withExistingResourceGroup("default-azurebatch-japaneast") + .withIdentity(new BatchAccountIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withAutoStorage(new AutoStorageBaseProperties().withStorageAccountId( + "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage")) + .create(); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountCreate_Default.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_Default.json */ /** * Sample code: BatchAccountCreate_Default. @@ -363,7 +416,11 @@ public final class BatchAccountCreateSamples { * @param manager Entry point to BatchManager. */ public static void batchAccountCreateDefault(com.azure.resourcemanager.batch.BatchManager manager) { - manager.batchAccounts().define("sampleacct").withRegion("japaneast").withExistingResourceGroup("default-azurebatch-japaneast").withAutoStorage(new AutoStorageBaseProperties().withStorageAccountId("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage")).create(); + manager.batchAccounts().define("sampleacct").withRegion("japaneast") + .withExistingResourceGroup("default-azurebatch-japaneast") + .withAutoStorage(new AutoStorageBaseProperties().withStorageAccountId( + "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage")) + .create(); } // Use "Map.of" if available @@ -388,7 +445,8 @@ public final class BatchAccountCreateSamples { */ public final class BatchAccountDeleteSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountDelete.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountDelete.json */ /** * Sample code: BatchAccountDelete. @@ -409,7 +467,8 @@ public final class BatchAccountDeleteSamples { */ public final class BatchAccountGetByResourceGroupSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PrivateBatchAccountGet.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateBatchAccountGet.json */ /** * Sample code: PrivateBatchAccountGet. @@ -417,11 +476,13 @@ public final class BatchAccountGetByResourceGroupSamples { * @param manager Entry point to BatchManager. */ public static void privateBatchAccountGet(com.azure.resourcemanager.batch.BatchManager manager) { - manager.batchAccounts().getByResourceGroupWithResponse("default-azurebatch-japaneast", "sampleacct", com.azure.core.util.Context.NONE); + manager.batchAccounts().getByResourceGroupWithResponse("default-azurebatch-japaneast", "sampleacct", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountGet.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountGet.json */ /** * Sample code: BatchAccountGet. @@ -429,7 +490,8 @@ public final class BatchAccountGetByResourceGroupSamples { * @param manager Entry point to BatchManager. */ public static void batchAccountGet(com.azure.resourcemanager.batch.BatchManager manager) { - manager.batchAccounts().getByResourceGroupWithResponse("default-azurebatch-japaneast", "sampleacct", com.azure.core.util.Context.NONE); + manager.batchAccounts().getByResourceGroupWithResponse("default-azurebatch-japaneast", "sampleacct", + com.azure.core.util.Context.NONE); } } ``` @@ -442,7 +504,8 @@ public final class BatchAccountGetByResourceGroupSamples { */ public final class BatchAccountGetDetectorSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/DetectorGet.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/DetectorGet.json */ /** * Sample code: GetDetector. @@ -450,7 +513,8 @@ public final class BatchAccountGetDetectorSamples { * @param manager Entry point to BatchManager. */ public static void getDetector(com.azure.resourcemanager.batch.BatchManager manager) { - manager.batchAccounts().getDetectorWithResponse("default-azurebatch-japaneast", "sampleacct", "poolsAndNodes", com.azure.core.util.Context.NONE); + manager.batchAccounts().getDetectorWithResponse("default-azurebatch-japaneast", "sampleacct", "poolsAndNodes", + com.azure.core.util.Context.NONE); } } ``` @@ -463,7 +527,8 @@ public final class BatchAccountGetDetectorSamples { */ public final class BatchAccountGetKeysSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountGetKeys.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountGetKeys.json */ /** * Sample code: BatchAccountGetKeys. @@ -471,7 +536,8 @@ public final class BatchAccountGetKeysSamples { * @param manager Entry point to BatchManager. */ public static void batchAccountGetKeys(com.azure.resourcemanager.batch.BatchManager manager) { - manager.batchAccounts().getKeysWithResponse("default-azurebatch-japaneast", "sampleacct", com.azure.core.util.Context.NONE); + manager.batchAccounts().getKeysWithResponse("default-azurebatch-japaneast", "sampleacct", + com.azure.core.util.Context.NONE); } } ``` @@ -484,7 +550,8 @@ public final class BatchAccountGetKeysSamples { */ public final class BatchAccountListSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountList.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountList.json */ /** * Sample code: BatchAccountList. @@ -505,7 +572,9 @@ public final class BatchAccountListSamples { */ public final class BatchAccountListByResourceGroupSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountListByResourceGroup.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountListByResourceGroup. + * json */ /** * Sample code: BatchAccountListByResourceGroup. @@ -526,7 +595,8 @@ public final class BatchAccountListByResourceGroupSamples { */ public final class BatchAccountListDetectorsSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/DetectorList.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/DetectorList.json */ /** * Sample code: ListDetectors. @@ -534,7 +604,8 @@ public final class BatchAccountListDetectorsSamples { * @param manager Entry point to BatchManager. */ public static void listDetectors(com.azure.resourcemanager.batch.BatchManager manager) { - manager.batchAccounts().listDetectors("default-azurebatch-japaneast", "sampleacct", com.azure.core.util.Context.NONE); + manager.batchAccounts().listDetectors("default-azurebatch-japaneast", "sampleacct", + com.azure.core.util.Context.NONE); } } ``` @@ -547,7 +618,8 @@ public final class BatchAccountListDetectorsSamples { */ public final class BatchAccountListOutboundNetworkDependenciesEndpointsSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ + * BatchAccountListOutboundNetworkDependenciesEndpoints.json */ /** * Sample code: ListOutboundNetworkDependencies. @@ -555,7 +627,8 @@ public final class BatchAccountListOutboundNetworkDependenciesEndpointsSamples { * @param manager Entry point to BatchManager. */ public static void listOutboundNetworkDependencies(com.azure.resourcemanager.batch.BatchManager manager) { - manager.batchAccounts().listOutboundNetworkDependenciesEndpoints("default-azurebatch-japaneast", "sampleacct", com.azure.core.util.Context.NONE); + manager.batchAccounts().listOutboundNetworkDependenciesEndpoints("default-azurebatch-japaneast", "sampleacct", + com.azure.core.util.Context.NONE); } } ``` @@ -565,14 +638,14 @@ public final class BatchAccountListOutboundNetworkDependenciesEndpointsSamples { ```java import com.azure.resourcemanager.batch.models.AccountKeyType; import com.azure.resourcemanager.batch.models.BatchAccountRegenerateKeyParameters; -import java.util.stream.Collectors; /** * Samples for BatchAccount RegenerateKey. */ public final class BatchAccountRegenerateKeySamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountRegenerateKey.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountRegenerateKey.json */ /** * Sample code: BatchAccountRegenerateKey. @@ -580,7 +653,9 @@ public final class BatchAccountRegenerateKeySamples { * @param manager Entry point to BatchManager. */ public static void batchAccountRegenerateKey(com.azure.resourcemanager.batch.BatchManager manager) { - manager.batchAccounts().regenerateKeyWithResponse("default-azurebatch-japaneast", "sampleacct", new BatchAccountRegenerateKeyParameters().withKeyName(AccountKeyType.PRIMARY), com.azure.core.util.Context.NONE); + manager.batchAccounts().regenerateKeyWithResponse("default-azurebatch-japaneast", "sampleacct", + new BatchAccountRegenerateKeyParameters().withKeyName(AccountKeyType.PRIMARY), + com.azure.core.util.Context.NONE); } } ``` @@ -593,7 +668,8 @@ public final class BatchAccountRegenerateKeySamples { */ public final class BatchAccountSynchronizeAutoStorageKeysSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountSynchronizeAutoStorageKeys.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ + * BatchAccountSynchronizeAutoStorageKeys.json */ /** * Sample code: BatchAccountSynchronizeAutoStorageKeys. @@ -601,7 +677,8 @@ public final class BatchAccountSynchronizeAutoStorageKeysSamples { * @param manager Entry point to BatchManager. */ public static void batchAccountSynchronizeAutoStorageKeys(com.azure.resourcemanager.batch.BatchManager manager) { - manager.batchAccounts().synchronizeAutoStorageKeysWithResponse("default-azurebatch-japaneast", "sampleacct", com.azure.core.util.Context.NONE); + manager.batchAccounts().synchronizeAutoStorageKeysWithResponse("default-azurebatch-japaneast", "sampleacct", + com.azure.core.util.Context.NONE); } } ``` @@ -617,7 +694,8 @@ import com.azure.resourcemanager.batch.models.BatchAccount; */ public final class BatchAccountUpdateSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountUpdate.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountUpdate.json */ /** * Sample code: BatchAccountUpdate. @@ -625,8 +703,11 @@ public final class BatchAccountUpdateSamples { * @param manager Entry point to BatchManager. */ public static void batchAccountUpdate(com.azure.resourcemanager.batch.BatchManager manager) { - BatchAccount resource = manager.batchAccounts().getByResourceGroupWithResponse("default-azurebatch-japaneast", "sampleacct", com.azure.core.util.Context.NONE).getValue(); - resource.update().withAutoStorage(new AutoStorageBaseProperties().withStorageAccountId("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage")).apply(); + BatchAccount resource = manager.batchAccounts().getByResourceGroupWithResponse("default-azurebatch-japaneast", + "sampleacct", com.azure.core.util.Context.NONE).getValue(); + resource.update().withAutoStorage(new AutoStorageBaseProperties().withStorageAccountId( + "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Storage/storageAccounts/samplestorage")) + .apply(); } } ``` @@ -639,7 +720,8 @@ public final class BatchAccountUpdateSamples { */ public final class CertificateCancelDeletionSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateCancelDeletion.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateCancelDeletion.json */ /** * Sample code: CertificateCancelDeletion. @@ -647,7 +729,8 @@ public final class CertificateCancelDeletionSamples { * @param manager Entry point to BatchManager. */ public static void certificateCancelDeletion(com.azure.resourcemanager.batch.BatchManager manager) { - manager.certificates().cancelDeletionWithResponse("default-azurebatch-japaneast", "sampleacct", "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", com.azure.core.util.Context.NONE); + manager.certificates().cancelDeletionWithResponse("default-azurebatch-japaneast", "sampleacct", + "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", com.azure.core.util.Context.NONE); } } ``` @@ -656,14 +739,14 @@ public final class CertificateCancelDeletionSamples { ```java import com.azure.resourcemanager.batch.models.CertificateFormat; -import java.util.stream.Collectors; /** * Samples for Certificate Create. */ public final class CertificateCreateSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateCreate_Full.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateCreate_Full.json */ /** * Sample code: CreateCertificate - Full. @@ -671,11 +754,15 @@ public final class CertificateCreateSamples { * @param manager Entry point to BatchManager. */ public static void createCertificateFull(com.azure.resourcemanager.batch.BatchManager manager) { - manager.certificates().define("sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withPassword("").withThumbprintAlgorithm("sha1").withThumbprint("0a0e4f50d51beadeac1d35afc5116098e7902e6e").withFormat(CertificateFormat.PFX).create(); + manager.certificates().define("sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e") + .withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withPassword("") + .withThumbprintAlgorithm("sha1").withThumbprint("0a0e4f50d51beadeac1d35afc5116098e7902e6e") + .withFormat(CertificateFormat.PFX).create(); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateCreate_Minimal.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateCreate_Minimal.json */ /** * Sample code: CreateCertificate - Minimal Pfx. @@ -683,11 +770,14 @@ public final class CertificateCreateSamples { * @param manager Entry point to BatchManager. */ public static void createCertificateMinimalPfx(com.azure.resourcemanager.batch.BatchManager manager) { - manager.certificates().define("sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withPassword("").create(); + manager.certificates().define("sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e") + .withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withPassword("") + .create(); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateCreate_MinimalCer.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateCreate_MinimalCer.json */ /** * Sample code: CreateCertificate - Minimal Cer. @@ -695,7 +785,9 @@ public final class CertificateCreateSamples { * @param manager Entry point to BatchManager. */ public static void createCertificateMinimalCer(com.azure.resourcemanager.batch.BatchManager manager) { - manager.certificates().define("sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withFormat(CertificateFormat.CER).create(); + manager.certificates().define("sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e") + .withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withFormat(CertificateFormat.CER) + .create(); } } ``` @@ -708,7 +800,8 @@ public final class CertificateCreateSamples { */ public final class CertificateDeleteSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateDelete.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateDelete.json */ /** * Sample code: CertificateDelete. @@ -716,7 +809,8 @@ public final class CertificateDeleteSamples { * @param manager Entry point to BatchManager. */ public static void certificateDelete(com.azure.resourcemanager.batch.BatchManager manager) { - manager.certificates().delete("default-azurebatch-japaneast", "sampleacct", "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", com.azure.core.util.Context.NONE); + manager.certificates().delete("default-azurebatch-japaneast", "sampleacct", + "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", com.azure.core.util.Context.NONE); } } ``` @@ -729,7 +823,9 @@ public final class CertificateDeleteSamples { */ public final class CertificateGetSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateGetWithDeletionError.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateGetWithDeletionError. + * json */ /** * Sample code: Get Certificate with Deletion Error. @@ -737,11 +833,13 @@ public final class CertificateGetSamples { * @param manager Entry point to BatchManager. */ public static void getCertificateWithDeletionError(com.azure.resourcemanager.batch.BatchManager manager) { - manager.certificates().getWithResponse("default-azurebatch-japaneast", "sampleacct", "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", com.azure.core.util.Context.NONE); + manager.certificates().getWithResponse("default-azurebatch-japaneast", "sampleacct", + "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateGet.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateGet.json */ /** * Sample code: Get Certificate. @@ -749,7 +847,8 @@ public final class CertificateGetSamples { * @param manager Entry point to BatchManager. */ public static void getCertificate(com.azure.resourcemanager.batch.BatchManager manager) { - manager.certificates().getWithResponse("default-azurebatch-japaneast", "sampleacct", "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", com.azure.core.util.Context.NONE); + manager.certificates().getWithResponse("default-azurebatch-japaneast", "sampleacct", + "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", com.azure.core.util.Context.NONE); } } ``` @@ -762,7 +861,8 @@ public final class CertificateGetSamples { */ public final class CertificateListByBatchAccountSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateListWithFilter.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateListWithFilter.json */ /** * Sample code: ListCertificates - Filter and Select. @@ -770,11 +870,15 @@ public final class CertificateListByBatchAccountSamples { * @param manager Entry point to BatchManager. */ public static void listCertificatesFilterAndSelect(com.azure.resourcemanager.batch.BatchManager manager) { - manager.certificates().listByBatchAccount("default-azurebatch-japaneast", "sampleacct", null, "properties/format,properties/provisioningState", "properties/provisioningStateTransitionTime gt '2017-05-01' or properties/provisioningState eq 'Failed'", com.azure.core.util.Context.NONE); + manager.certificates().listByBatchAccount("default-azurebatch-japaneast", "sampleacct", null, + "properties/format,properties/provisioningState", + "properties/provisioningStateTransitionTime gt '2017-05-01' or properties/provisioningState eq 'Failed'", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateList.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateList.json */ /** * Sample code: ListCertificates. @@ -782,7 +886,8 @@ public final class CertificateListByBatchAccountSamples { * @param manager Entry point to BatchManager. */ public static void listCertificates(com.azure.resourcemanager.batch.BatchManager manager) { - manager.certificates().listByBatchAccount("default-azurebatch-japaneast", "sampleacct", 1, null, null, com.azure.core.util.Context.NONE); + manager.certificates().listByBatchAccount("default-azurebatch-japaneast", "sampleacct", 1, null, null, + com.azure.core.util.Context.NONE); } } ``` @@ -797,7 +902,8 @@ import com.azure.resourcemanager.batch.models.Certificate; */ public final class CertificateUpdateSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateUpdate.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateUpdate.json */ /** * Sample code: UpdateCertificate. @@ -805,7 +911,8 @@ public final class CertificateUpdateSamples { * @param manager Entry point to BatchManager. */ public static void updateCertificate(com.azure.resourcemanager.batch.BatchManager manager) { - Certificate resource = manager.certificates().getWithResponse("default-azurebatch-japaneast", "sampleacct", "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", com.azure.core.util.Context.NONE).getValue(); + Certificate resource = manager.certificates().getWithResponse("default-azurebatch-japaneast", "sampleacct", + "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e", com.azure.core.util.Context.NONE).getValue(); resource.update().withData("MIIJsgIBAzCCCW4GCSqGSIb3DQE...").withPassword("").apply(); } } @@ -821,19 +928,23 @@ import com.azure.resourcemanager.batch.models.CheckNameAvailabilityParameters; */ public final class LocationCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/LocationCheckNameAvailability_AlreadyExists.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ + * LocationCheckNameAvailability_AlreadyExists.json */ /** * Sample code: LocationCheckNameAvailability_AlreadyExists. * * @param manager Entry point to BatchManager. */ - public static void locationCheckNameAvailabilityAlreadyExists(com.azure.resourcemanager.batch.BatchManager manager) { - manager.locations().checkNameAvailabilityWithResponse("japaneast", new CheckNameAvailabilityParameters().withName("existingaccountname"), com.azure.core.util.Context.NONE); + public static void + locationCheckNameAvailabilityAlreadyExists(com.azure.resourcemanager.batch.BatchManager manager) { + manager.locations().checkNameAvailabilityWithResponse("japaneast", + new CheckNameAvailabilityParameters().withName("existingaccountname"), com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/LocationCheckNameAvailability_Available.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ + * LocationCheckNameAvailability_Available.json */ /** * Sample code: LocationCheckNameAvailability_Available. @@ -841,7 +952,8 @@ public final class LocationCheckNameAvailabilitySamples { * @param manager Entry point to BatchManager. */ public static void locationCheckNameAvailabilityAvailable(com.azure.resourcemanager.batch.BatchManager manager) { - manager.locations().checkNameAvailabilityWithResponse("japaneast", new CheckNameAvailabilityParameters().withName("newaccountname"), com.azure.core.util.Context.NONE); + manager.locations().checkNameAvailabilityWithResponse("japaneast", + new CheckNameAvailabilityParameters().withName("newaccountname"), com.azure.core.util.Context.NONE); } } ``` @@ -854,7 +966,8 @@ public final class LocationCheckNameAvailabilitySamples { */ public final class LocationGetQuotasSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/LocationGetQuotas.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/LocationGetQuotas.json */ /** * Sample code: LocationGetQuotas. @@ -875,7 +988,8 @@ public final class LocationGetQuotasSamples { */ public final class LocationListSupportedCloudServiceSkusSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/LocationListCloudServiceSkus.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/LocationListCloudServiceSkus.json */ /** * Sample code: LocationListCloudServiceSkus. @@ -896,7 +1010,9 @@ public final class LocationListSupportedCloudServiceSkusSamples { */ public final class LocationListSupportedVirtualMachineSkusSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/LocationListVirtualMachineSkus.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/LocationListVirtualMachineSkus. + * json */ /** * Sample code: LocationListVirtualMachineSkus. @@ -917,7 +1033,8 @@ public final class LocationListSupportedVirtualMachineSkusSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/OperationsList.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/OperationsList.json */ /** * Sample code: OperationsList. @@ -939,6 +1056,7 @@ import com.azure.resourcemanager.batch.models.ApplicationPackageReference; import com.azure.resourcemanager.batch.models.AutoScaleSettings; import com.azure.resourcemanager.batch.models.AutoUserScope; import com.azure.resourcemanager.batch.models.AutoUserSpecification; +import com.azure.resourcemanager.batch.models.AutomaticOSUpgradePolicy; import com.azure.resourcemanager.batch.models.BatchPoolIdentity; import com.azure.resourcemanager.batch.models.CachingType; import com.azure.resourcemanager.batch.models.CertificateReference; @@ -975,6 +1093,7 @@ import com.azure.resourcemanager.batch.models.PoolEndpointConfiguration; import com.azure.resourcemanager.batch.models.PoolIdentityType; import com.azure.resourcemanager.batch.models.PublicIpAddressConfiguration; import com.azure.resourcemanager.batch.models.ResourceFile; +import com.azure.resourcemanager.batch.models.RollingUpgradePolicy; import com.azure.resourcemanager.batch.models.ScaleSettings; import com.azure.resourcemanager.batch.models.SecurityProfile; import com.azure.resourcemanager.batch.models.SecurityTypes; @@ -983,37 +1102,55 @@ import com.azure.resourcemanager.batch.models.StartTask; import com.azure.resourcemanager.batch.models.StorageAccountType; import com.azure.resourcemanager.batch.models.TaskSchedulingPolicy; import com.azure.resourcemanager.batch.models.UefiSettings; +import com.azure.resourcemanager.batch.models.UpgradeMode; +import com.azure.resourcemanager.batch.models.UpgradePolicy; import com.azure.resourcemanager.batch.models.UserAccount; import com.azure.resourcemanager.batch.models.UserAssignedIdentities; import com.azure.resourcemanager.batch.models.UserIdentity; -import com.azure.resourcemanager.batch.models.VirtualMachineConfiguration; import com.azure.resourcemanager.batch.models.VMExtension; +import com.azure.resourcemanager.batch.models.VirtualMachineConfiguration; import com.azure.resourcemanager.batch.models.WindowsConfiguration; import java.io.IOException; import java.time.Duration; import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import java.util.stream.Collectors; /** * Samples for Pool Create. */ public final class PoolCreateSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_VirtualMachineConfiguration_ServiceArtifactReference.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ + * PoolCreate_VirtualMachineConfiguration_ServiceArtifactReference.json */ /** * Sample code: CreatePool - VirtualMachineConfiguration ServiceArtifactReference. * * @param manager Entry point to BatchManager. */ - public static void createPoolVirtualMachineConfigurationServiceArtifactReference(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withVmSize("Standard_d4s_v3").withDeploymentConfiguration(new DeploymentConfiguration().withVirtualMachineConfiguration(new VirtualMachineConfiguration().withImageReference(new ImageReference().withPublisher("MicrosoftWindowsServer").withOffer("WindowsServer").withSku("2019-datacenter-smalldisk").withVersion("latest")).withNodeAgentSkuId("batch.node.windows amd64").withWindowsConfiguration(new WindowsConfiguration().withEnableAutomaticUpdates(false)).withServiceArtifactReference(new ServiceArtifactReference().withId("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile")))).withScaleSettings(new ScaleSettings().withFixedScale(new FixedScaleSettings().withTargetDedicatedNodes(2).withTargetLowPriorityNodes(0))).create(); + public static void createPoolVirtualMachineConfigurationServiceArtifactReference( + com.azure.resourcemanager.batch.BatchManager manager) { + manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct") + .withVmSize("Standard_d4s_v3") + .withDeploymentConfiguration( + new DeploymentConfiguration().withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withImageReference(new ImageReference().withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer").withSku("2019-datacenter-smalldisk").withVersion("latest")) + .withNodeAgentSkuId("batch.node.windows amd64") + .withWindowsConfiguration(new WindowsConfiguration().withEnableAutomaticUpdates(false)) + .withServiceArtifactReference(new ServiceArtifactReference().withId( + "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile")))) + .withScaleSettings(new ScaleSettings() + .withFixedScale(new FixedScaleSettings().withTargetDedicatedNodes(2).withTargetLowPriorityNodes(0))) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.AUTOMATIC) + .withAutomaticOSUpgradePolicy(new AutomaticOSUpgradePolicy().withEnableAutomaticOSUpgrade(true))) + .create(); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_SecurityProfile.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolCreate_SecurityProfile.json */ /** * Sample code: CreatePool - SecurityProfile. @@ -1021,59 +1158,125 @@ public final class PoolCreateSamples { * @param manager Entry point to BatchManager. */ public static void createPoolSecurityProfile(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withVmSize("Standard_d4s_v3").withDeploymentConfiguration(new DeploymentConfiguration().withVirtualMachineConfiguration(new VirtualMachineConfiguration().withImageReference(new ImageReference().withPublisher("Canonical").withOffer("UbuntuServer").withSku("18_04-lts-gen2").withVersion("latest")).withNodeAgentSkuId("batch.node.ubuntu 18.04").withSecurityProfile(new SecurityProfile().withSecurityType(SecurityTypes.TRUSTED_LAUNCH).withEncryptionAtHost(true).withUefiSettings(new UefiSettings().withVTpmEnabled(false))))).withScaleSettings(new ScaleSettings().withFixedScale(new FixedScaleSettings().withTargetDedicatedNodes(1).withTargetLowPriorityNodes(0))).create(); + manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct") + .withVmSize("Standard_d4s_v3") + .withDeploymentConfiguration( + new DeploymentConfiguration() + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withImageReference(new ImageReference().withPublisher("Canonical").withOffer("UbuntuServer") + .withSku("18_04-lts-gen2").withVersion("latest")) + .withNodeAgentSkuId("batch.node.ubuntu 18.04") + .withSecurityProfile(new SecurityProfile().withSecurityType(SecurityTypes.TRUSTED_LAUNCH) + .withEncryptionAtHost(true).withUefiSettings(new UefiSettings().withVTpmEnabled(false))))) + .withScaleSettings(new ScaleSettings() + .withFixedScale(new FixedScaleSettings().withTargetDedicatedNodes(1).withTargetLowPriorityNodes(0))) + .create(); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_VirtualMachineConfiguration_ManagedOSDisk.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ + * PoolCreate_VirtualMachineConfiguration_ManagedOSDisk.json */ /** * Sample code: CreatePool - VirtualMachineConfiguration OSDisk. * * @param manager Entry point to BatchManager. */ - public static void createPoolVirtualMachineConfigurationOSDisk(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withVmSize("Standard_d2s_v3").withDeploymentConfiguration(new DeploymentConfiguration().withVirtualMachineConfiguration(new VirtualMachineConfiguration().withImageReference(new ImageReference().withPublisher("microsoftwindowsserver").withOffer("windowsserver").withSku("2022-datacenter-smalldisk")).withNodeAgentSkuId("batch.node.windows amd64").withOsDisk(new OSDisk().withCaching(CachingType.READ_WRITE).withManagedDisk(new ManagedDisk().withStorageAccountType(StorageAccountType.STANDARD_SSD_LRS)).withDiskSizeGB(100).withWriteAcceleratorEnabled(false)))).withScaleSettings(new ScaleSettings().withFixedScale(new FixedScaleSettings().withTargetDedicatedNodes(1).withTargetLowPriorityNodes(0))).create(); + public static void + createPoolVirtualMachineConfigurationOSDisk(com.azure.resourcemanager.batch.BatchManager manager) { + manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct") + .withVmSize("Standard_d2s_v3") + .withDeploymentConfiguration( + new DeploymentConfiguration().withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withImageReference(new ImageReference().withPublisher("microsoftwindowsserver") + .withOffer("windowsserver").withSku("2022-datacenter-smalldisk")) + .withNodeAgentSkuId("batch.node.windows amd64") + .withOsDisk(new OSDisk().withCaching(CachingType.READ_WRITE) + .withManagedDisk(new ManagedDisk().withStorageAccountType(StorageAccountType.STANDARD_SSD_LRS)) + .withDiskSizeGB(100).withWriteAcceleratorEnabled(false)))) + .withScaleSettings(new ScaleSettings() + .withFixedScale(new FixedScaleSettings().withTargetDedicatedNodes(1).withTargetLowPriorityNodes(0))) + .create(); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_MinimalCloudServiceConfiguration.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ + * PoolCreate_MinimalCloudServiceConfiguration.json */ /** * Sample code: CreatePool - Minimal CloudServiceConfiguration. * * @param manager Entry point to BatchManager. */ - public static void createPoolMinimalCloudServiceConfiguration(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withVmSize("STANDARD_D4").withDeploymentConfiguration(new DeploymentConfiguration().withCloudServiceConfiguration(new CloudServiceConfiguration().withOsFamily("5"))).withScaleSettings(new ScaleSettings().withFixedScale(new FixedScaleSettings().withTargetDedicatedNodes(3))).create(); + public static void + createPoolMinimalCloudServiceConfiguration(com.azure.resourcemanager.batch.BatchManager manager) { + manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct") + .withVmSize("STANDARD_D4") + .withDeploymentConfiguration(new DeploymentConfiguration() + .withCloudServiceConfiguration(new CloudServiceConfiguration().withOsFamily("5"))) + .withScaleSettings(new ScaleSettings().withFixedScale(new FixedScaleSettings().withTargetDedicatedNodes(3))) + .create(); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_MinimalVirtualMachineConfiguration.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ + * PoolCreate_MinimalVirtualMachineConfiguration.json */ /** * Sample code: CreatePool - Minimal VirtualMachineConfiguration. * * @param manager Entry point to BatchManager. */ - public static void createPoolMinimalVirtualMachineConfiguration(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withVmSize("STANDARD_D4").withDeploymentConfiguration(new DeploymentConfiguration().withVirtualMachineConfiguration(new VirtualMachineConfiguration().withImageReference(new ImageReference().withPublisher("Canonical").withOffer("UbuntuServer").withSku("18.04-LTS").withVersion("latest")).withNodeAgentSkuId("batch.node.ubuntu 18.04"))).withScaleSettings(new ScaleSettings().withAutoScale(new AutoScaleSettings().withFormula("$TargetDedicatedNodes=1").withEvaluationInterval(Duration.parse("PT5M")))).create(); + public static void + createPoolMinimalVirtualMachineConfiguration(com.azure.resourcemanager.batch.BatchManager manager) { + manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct") + .withVmSize("STANDARD_D4") + .withDeploymentConfiguration( + new DeploymentConfiguration() + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withImageReference(new ImageReference().withPublisher("Canonical") + .withOffer("UbuntuServer").withSku("18.04-LTS").withVersion("latest")) + .withNodeAgentSkuId("batch.node.ubuntu 18.04"))) + .withScaleSettings(new ScaleSettings().withAutoScale(new AutoScaleSettings() + .withFormula("$TargetDedicatedNodes=1").withEvaluationInterval(Duration.parse("PT5M")))) + .create(); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_VirtualMachineConfiguration_Extensions.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ + * PoolCreate_VirtualMachineConfiguration_Extensions.json */ /** * Sample code: CreatePool - VirtualMachineConfiguration Extensions. * * @param manager Entry point to BatchManager. */ - public static void createPoolVirtualMachineConfigurationExtensions(com.azure.resourcemanager.batch.BatchManager manager) throws IOException { - manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withVmSize("STANDARD_D4").withDeploymentConfiguration(new DeploymentConfiguration().withVirtualMachineConfiguration(new VirtualMachineConfiguration().withImageReference(new ImageReference().withPublisher("Canonical").withOffer("0001-com-ubuntu-server-focal").withSku("20_04-lts")).withNodeAgentSkuId("batch.node.ubuntu 20.04").withExtensions(Arrays.asList(new VMExtension().withName("batchextension1").withPublisher("Microsoft.Azure.KeyVault").withType("KeyVaultForLinux").withTypeHandlerVersion("2.0").withAutoUpgradeMinorVersion(true).withEnableAutomaticUpgrade(true).withSettings(SerializerFactory.createDefaultManagementSerializerAdapter().deserialize("{\"authenticationSettingsKey\":\"authenticationSettingsValue\",\"secretsManagementSettingsKey\":\"secretsManagementSettingsValue\"}", Object.class, SerializerEncoding.JSON)))))).withScaleSettings(new ScaleSettings().withAutoScale(new AutoScaleSettings().withFormula("$TargetDedicatedNodes=1").withEvaluationInterval(Duration.parse("PT5M")))).withTargetNodeCommunicationMode(NodeCommunicationMode.DEFAULT).create(); + public static void createPoolVirtualMachineConfigurationExtensions( + com.azure.resourcemanager.batch.BatchManager manager) throws IOException { + manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct") + .withVmSize("STANDARD_D4") + .withDeploymentConfiguration( + new DeploymentConfiguration().withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withImageReference(new ImageReference().withPublisher("Canonical") + .withOffer("0001-com-ubuntu-server-focal").withSku("20_04-lts")) + .withNodeAgentSkuId("batch.node.ubuntu 20.04") + .withExtensions(Arrays.asList(new VMExtension().withName("batchextension1") + .withPublisher("Microsoft.Azure.KeyVault").withType("KeyVaultForLinux") + .withTypeHandlerVersion("2.0").withAutoUpgradeMinorVersion(true) + .withEnableAutomaticUpgrade(true) + .withSettings(SerializerFactory.createDefaultManagementSerializerAdapter().deserialize( + "{\"authenticationSettingsKey\":\"authenticationSettingsValue\",\"secretsManagementSettingsKey\":\"secretsManagementSettingsValue\"}", + Object.class, SerializerEncoding.JSON)))))) + .withScaleSettings(new ScaleSettings().withAutoScale(new AutoScaleSettings() + .withFormula("$TargetDedicatedNodes=1").withEvaluationInterval(Duration.parse("PT5M")))) + .withTargetNodeCommunicationMode(NodeCommunicationMode.DEFAULT).create(); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_UserAssignedIdentities.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolCreate_UserAssignedIdentities + * .json */ /** * Sample code: CreatePool - UserAssignedIdentities. @@ -1081,11 +1284,64 @@ public final class PoolCreateSamples { * @param manager Entry point to BatchManager. */ public static void createPoolUserAssignedIdentities(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withIdentity(new BatchPoolIdentity().withType(PoolIdentityType.USER_ASSIGNED).withUserAssignedIdentities(mapOf("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", new UserAssignedIdentities(), "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2", new UserAssignedIdentities()))).withVmSize("STANDARD_D4").withDeploymentConfiguration(new DeploymentConfiguration().withVirtualMachineConfiguration(new VirtualMachineConfiguration().withImageReference(new ImageReference().withPublisher("Canonical").withOffer("UbuntuServer").withSku("18.04-LTS").withVersion("latest")).withNodeAgentSkuId("batch.node.ubuntu 18.04"))).withScaleSettings(new ScaleSettings().withAutoScale(new AutoScaleSettings().withFormula("$TargetDedicatedNodes=1").withEvaluationInterval(Duration.parse("PT5M")))).create(); - } - - /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_AcceleratedNetworking.json + manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct") + .withIdentity(new BatchPoolIdentity().withType(PoolIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", + new UserAssignedIdentities(), + "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2", + new UserAssignedIdentities()))) + .withVmSize("STANDARD_D4") + .withDeploymentConfiguration( + new DeploymentConfiguration() + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withImageReference(new ImageReference().withPublisher("Canonical") + .withOffer("UbuntuServer").withSku("18.04-LTS").withVersion("latest")) + .withNodeAgentSkuId("batch.node.ubuntu 18.04"))) + .withScaleSettings(new ScaleSettings().withAutoScale(new AutoScaleSettings() + .withFormula("$TargetDedicatedNodes=1").withEvaluationInterval(Duration.parse("PT5M")))) + .create(); + } + + /* + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolCreate_UpgradePolicy.json + */ + /** + * Sample code: CreatePool - UpgradePolicy. + * + * @param manager Entry point to BatchManager. + */ + public static void createPoolUpgradePolicy(com.azure.resourcemanager.batch.BatchManager manager) { + manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct") + .withVmSize("Standard_d4s_v3") + .withDeploymentConfiguration( + new DeploymentConfiguration().withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withImageReference(new ImageReference().withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer").withSku("2019-datacenter-smalldisk").withVersion("latest")) + .withNodeAgentSkuId("batch.node.windows amd64") + .withWindowsConfiguration(new WindowsConfiguration().withEnableAutomaticUpdates(false)) + .withNodePlacementConfiguration( + new NodePlacementConfiguration().withPolicy(NodePlacementPolicyType.ZONAL)))) + .withScaleSettings(new ScaleSettings() + .withFixedScale(new FixedScaleSettings().withTargetDedicatedNodes(2).withTargetLowPriorityNodes(0))) + .withUpgradePolicy( + new UpgradePolicy().withMode(UpgradeMode.AUTOMATIC) + .withAutomaticOSUpgradePolicy(new AutomaticOSUpgradePolicy().withDisableAutomaticRollback(true) + .withEnableAutomaticOSUpgrade(true).withUseRollingUpgradePolicy(true) + .withOsRollingUpgradeDeferral(true)) + .withRollingUpgradePolicy(new RollingUpgradePolicy().withEnableCrossZoneUpgrade(true) + .withMaxBatchInstancePercent(20).withMaxUnhealthyInstancePercent(20) + .withMaxUnhealthyUpgradedInstancePercent(20).withPauseTimeBetweenBatches("PT0S") + .withPrioritizeUnhealthyInstances(false).withRollbackFailedInstancesOnPolicyBreach(false))) + .create(); + } + + /* + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolCreate_AcceleratedNetworking. + * json */ /** * Sample code: CreatePool - accelerated networking. @@ -1093,11 +1349,24 @@ public final class PoolCreateSamples { * @param manager Entry point to BatchManager. */ public static void createPoolAcceleratedNetworking(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withVmSize("STANDARD_D1_V2").withDeploymentConfiguration(new DeploymentConfiguration().withVirtualMachineConfiguration(new VirtualMachineConfiguration().withImageReference(new ImageReference().withPublisher("MicrosoftWindowsServer").withOffer("WindowsServer").withSku("2016-datacenter-smalldisk").withVersion("latest")).withNodeAgentSkuId("batch.node.windows amd64"))).withScaleSettings(new ScaleSettings().withFixedScale(new FixedScaleSettings().withTargetDedicatedNodes(1).withTargetLowPriorityNodes(0))).withNetworkConfiguration(new NetworkConfiguration().withSubnetId("/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123").withEnableAcceleratedNetworking(true)).create(); + manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct") + .withVmSize("STANDARD_D1_V2") + .withDeploymentConfiguration( + new DeploymentConfiguration().withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withImageReference(new ImageReference().withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer").withSku("2016-datacenter-smalldisk").withVersion("latest")) + .withNodeAgentSkuId("batch.node.windows amd64"))) + .withScaleSettings(new ScaleSettings() + .withFixedScale(new FixedScaleSettings().withTargetDedicatedNodes(1).withTargetLowPriorityNodes(0))) + .withNetworkConfiguration(new NetworkConfiguration().withSubnetId( + "/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123") + .withEnableAcceleratedNetworking(true)) + .create(); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_VirtualMachineConfiguration.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ + * PoolCreate_VirtualMachineConfiguration.json */ /** * Sample code: CreatePool - Full VirtualMachineConfiguration. @@ -1105,11 +1374,51 @@ public final class PoolCreateSamples { * @param manager Entry point to BatchManager. */ public static void createPoolFullVirtualMachineConfiguration(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withVmSize("STANDARD_D4").withDeploymentConfiguration(new DeploymentConfiguration().withVirtualMachineConfiguration(new VirtualMachineConfiguration().withImageReference(new ImageReference().withPublisher("MicrosoftWindowsServer").withOffer("WindowsServer").withSku("2016-Datacenter-SmallDisk").withVersion("latest")).withNodeAgentSkuId("batch.node.windows amd64").withWindowsConfiguration(new WindowsConfiguration().withEnableAutomaticUpdates(false)).withDataDisks(Arrays.asList(new DataDisk().withLun(0).withCaching(CachingType.READ_WRITE).withDiskSizeGB(30).withStorageAccountType(StorageAccountType.PREMIUM_LRS), new DataDisk().withLun(1).withCaching(CachingType.NONE).withDiskSizeGB(200).withStorageAccountType(StorageAccountType.STANDARD_LRS))).withLicenseType("Windows_Server").withDiskEncryptionConfiguration(new DiskEncryptionConfiguration().withTargets(Arrays.asList(DiskEncryptionTarget.OS_DISK, DiskEncryptionTarget.TEMPORARY_DISK))).withNodePlacementConfiguration(new NodePlacementConfiguration().withPolicy(NodePlacementPolicyType.ZONAL)).withOsDisk(new OSDisk().withEphemeralOSDiskSettings(new DiffDiskSettings().withPlacement(DiffDiskPlacement.CACHE_DISK))))).withScaleSettings(new ScaleSettings().withAutoScale(new AutoScaleSettings().withFormula("$TargetDedicatedNodes=1").withEvaluationInterval(Duration.parse("PT5M")))).withNetworkConfiguration(new NetworkConfiguration().withEndpointConfiguration(new PoolEndpointConfiguration().withInboundNatPools(Arrays.asList(new InboundNatPool().withName("testnat").withProtocol(InboundEndpointProtocol.TCP).withBackendPort(12001).withFrontendPortRangeStart(15000).withFrontendPortRangeEnd(15100).withNetworkSecurityGroupRules(Arrays.asList(new NetworkSecurityGroupRule().withPriority(150).withAccess(NetworkSecurityGroupRuleAccess.ALLOW).withSourceAddressPrefix("192.100.12.45").withSourcePortRanges(Arrays.asList("1", "2")), new NetworkSecurityGroupRule().withPriority(3500).withAccess(NetworkSecurityGroupRuleAccess.DENY).withSourceAddressPrefix("*").withSourcePortRanges(Arrays.asList("*")))))))).create(); - } - - /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_SharedImageGallery.json + manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct") + .withVmSize("STANDARD_D4") + .withDeploymentConfiguration( + new DeploymentConfiguration() + .withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withImageReference(new ImageReference().withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer").withSku("2016-Datacenter-SmallDisk").withVersion("latest")) + .withNodeAgentSkuId("batch.node.windows amd64") + .withWindowsConfiguration(new WindowsConfiguration().withEnableAutomaticUpdates(false)) + .withDataDisks(Arrays.asList( + new DataDisk().withLun(0).withCaching(CachingType.READ_WRITE).withDiskSizeGB(30) + .withStorageAccountType(StorageAccountType.PREMIUM_LRS), + new DataDisk().withLun(1).withCaching(CachingType.NONE).withDiskSizeGB(200) + .withStorageAccountType(StorageAccountType.STANDARD_LRS))) + .withLicenseType("Windows_Server") + .withDiskEncryptionConfiguration(new DiskEncryptionConfiguration().withTargets( + Arrays.asList(DiskEncryptionTarget.OS_DISK, DiskEncryptionTarget.TEMPORARY_DISK))) + .withNodePlacementConfiguration( + new NodePlacementConfiguration().withPolicy(NodePlacementPolicyType.ZONAL)) + .withOsDisk(new OSDisk().withEphemeralOSDiskSettings( + new DiffDiskSettings().withPlacement(DiffDiskPlacement.CACHE_DISK))))) + .withScaleSettings( + new ScaleSettings() + .withAutoScale( + new AutoScaleSettings().withFormula( + "$TargetDedicatedNodes=1").withEvaluationInterval( + Duration.parse("PT5M")))) + .withNetworkConfiguration( + new NetworkConfiguration() + .withEndpointConfiguration(new PoolEndpointConfiguration().withInboundNatPools( + Arrays.asList(new InboundNatPool().withName("testnat").withProtocol(InboundEndpointProtocol.TCP) + .withBackendPort(12001).withFrontendPortRangeStart(15000).withFrontendPortRangeEnd(15100) + .withNetworkSecurityGroupRules(Arrays.asList(new NetworkSecurityGroupRule() + .withPriority(150).withAccess(NetworkSecurityGroupRuleAccess.ALLOW) + .withSourceAddressPrefix("192.100.12.45").withSourcePortRanges(Arrays.asList("1", "2")), + new NetworkSecurityGroupRule().withPriority(3500) + .withAccess(NetworkSecurityGroupRuleAccess.DENY).withSourceAddressPrefix("*") + .withSourcePortRanges(Arrays.asList("*")))))))) + .create(); + } + + /* + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolCreate_SharedImageGallery. + * json */ /** * Sample code: CreatePool - Custom Image. @@ -1117,11 +1426,18 @@ public final class PoolCreateSamples { * @param manager Entry point to BatchManager. */ public static void createPoolCustomImage(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withVmSize("STANDARD_D4").withDeploymentConfiguration(new DeploymentConfiguration().withVirtualMachineConfiguration(new VirtualMachineConfiguration().withImageReference(new ImageReference().withId("/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1")).withNodeAgentSkuId("batch.node.ubuntu 18.04"))).create(); + manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct") + .withVmSize("STANDARD_D4") + .withDeploymentConfiguration(new DeploymentConfiguration().withVirtualMachineConfiguration( + new VirtualMachineConfiguration().withImageReference(new ImageReference().withId( + "/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1")) + .withNodeAgentSkuId("batch.node.ubuntu 18.04"))) + .create(); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_CloudServiceConfiguration.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ + * PoolCreate_CloudServiceConfiguration.json */ /** * Sample code: CreatePool - Full CloudServiceConfiguration. @@ -1129,11 +1445,51 @@ public final class PoolCreateSamples { * @param manager Entry point to BatchManager. */ public static void createPoolFullCloudServiceConfiguration(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withDisplayName("my-pool-name").withVmSize("STANDARD_D4").withDeploymentConfiguration(new DeploymentConfiguration().withCloudServiceConfiguration(new CloudServiceConfiguration().withOsFamily("4").withOsVersion("WA-GUEST-OS-4.45_201708-01"))).withScaleSettings(new ScaleSettings().withFixedScale(new FixedScaleSettings().withResizeTimeout(Duration.parse("PT8M")).withTargetDedicatedNodes(6).withTargetLowPriorityNodes(28).withNodeDeallocationOption(ComputeNodeDeallocationOption.TASK_COMPLETION))).withInterNodeCommunication(InterNodeCommunicationState.ENABLED).withNetworkConfiguration(new NetworkConfiguration().withSubnetId("/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123").withPublicIpAddressConfiguration(new PublicIpAddressConfiguration().withProvision(IpAddressProvisioningType.USER_MANAGED).withIpAddressIds(Arrays.asList("/subscriptions/subid1/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135", "/subscriptions/subid2/resourceGroups/rg24/providers/Microsoft.Network/publicIPAddresses/ip268")))).withTaskSlotsPerNode(13).withTaskSchedulingPolicy(new TaskSchedulingPolicy().withNodeFillType(ComputeNodeFillType.PACK)).withUserAccounts(Arrays.asList(new UserAccount().withName("username1").withPassword("fakeTokenPlaceholder").withElevationLevel(ElevationLevel.ADMIN).withLinuxUserConfiguration(new LinuxUserConfiguration().withUid(1234).withGid(4567).withSshPrivateKey("fakeTokenPlaceholder")))).withMetadata(Arrays.asList(new MetadataItem().withName("metadata-1").withValue("value-1"), new MetadataItem().withName("metadata-2").withValue("value-2"))).withStartTask(new StartTask().withCommandLine("cmd /c SET").withResourceFiles(Arrays.asList(new ResourceFile().withHttpUrl("https://testaccount.blob.core.windows.net/example-blob-file").withFilePath("c:\\temp\\gohere").withFileMode("777"))).withEnvironmentSettings(Arrays.asList(new EnvironmentSetting().withName("MYSET").withValue("1234"))).withUserIdentity(new UserIdentity().withAutoUser(new AutoUserSpecification().withScope(AutoUserScope.POOL).withElevationLevel(ElevationLevel.ADMIN))).withMaxTaskRetryCount(6).withWaitForSuccess(true)).withCertificates(Arrays.asList(new CertificateReference().withId("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/certificates/sha1-1234567").withStoreLocation(CertificateStoreLocation.LOCAL_MACHINE).withStoreName("MY").withVisibility(Arrays.asList(CertificateVisibility.REMOTE_USER)))).withApplicationPackages(Arrays.asList(new ApplicationPackageReference().withId("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_1234").withVersion("asdf"))).withApplicationLicenses(Arrays.asList("app-license0", "app-license1")).create(); - } - - /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_NoPublicIPAddresses.json + manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct") + .withDisplayName("my-pool-name").withVmSize("STANDARD_D4") + .withDeploymentConfiguration(new DeploymentConfiguration().withCloudServiceConfiguration( + new CloudServiceConfiguration().withOsFamily("4").withOsVersion("WA-GUEST-OS-4.45_201708-01"))) + .withScaleSettings(new ScaleSettings().withFixedScale(new FixedScaleSettings() + .withResizeTimeout(Duration.parse("PT8M")).withTargetDedicatedNodes(6).withTargetLowPriorityNodes(28) + .withNodeDeallocationOption(ComputeNodeDeallocationOption.TASK_COMPLETION))) + .withInterNodeCommunication(InterNodeCommunicationState.ENABLED) + .withNetworkConfiguration(new NetworkConfiguration().withSubnetId( + "/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123") + .withPublicIpAddressConfiguration(new PublicIpAddressConfiguration() + .withProvision(IpAddressProvisioningType.USER_MANAGED) + .withIpAddressIds(Arrays.asList( + "/subscriptions/subid1/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135", + "/subscriptions/subid2/resourceGroups/rg24/providers/Microsoft.Network/publicIPAddresses/ip268")))) + .withTaskSlotsPerNode(13) + .withTaskSchedulingPolicy(new TaskSchedulingPolicy().withNodeFillType(ComputeNodeFillType.PACK)) + .withUserAccounts(Arrays.asList(new UserAccount().withName("username1").withPassword("fakeTokenPlaceholder") + .withElevationLevel(ElevationLevel.ADMIN) + .withLinuxUserConfiguration(new LinuxUserConfiguration().withUid(1234).withGid(4567) + .withSshPrivateKey("fakeTokenPlaceholder")))) + .withMetadata(Arrays.asList(new MetadataItem().withName("metadata-1").withValue("value-1"), + new MetadataItem().withName("metadata-2").withValue("value-2"))) + .withStartTask(new StartTask().withCommandLine("cmd /c SET") + .withResourceFiles(Arrays.asList( + new ResourceFile().withHttpUrl("https://testaccount.blob.core.windows.net/example-blob-file") + .withFilePath("c:\\temp\\gohere").withFileMode("777"))) + .withEnvironmentSettings(Arrays.asList(new EnvironmentSetting().withName("MYSET").withValue("1234"))) + .withUserIdentity(new UserIdentity().withAutoUser( + new AutoUserSpecification().withScope(AutoUserScope.POOL).withElevationLevel(ElevationLevel.ADMIN))) + .withMaxTaskRetryCount(6).withWaitForSuccess(true)) + .withCertificates(Arrays.asList(new CertificateReference().withId( + "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/certificates/sha1-1234567") + .withStoreLocation(CertificateStoreLocation.LOCAL_MACHINE).withStoreName("MY") + .withVisibility(Arrays.asList(CertificateVisibility.REMOTE_USER)))) + .withApplicationPackages(Arrays.asList(new ApplicationPackageReference().withId( + "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_1234") + .withVersion("asdf"))) + .withApplicationLicenses(Arrays.asList("app-license0", "app-license1")).create(); + } + + /* + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolCreate_NoPublicIPAddresses. + * json */ /** * Sample code: CreatePool - No public IP. @@ -1141,11 +1497,22 @@ public final class PoolCreateSamples { * @param manager Entry point to BatchManager. */ public static void createPoolNoPublicIP(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withVmSize("STANDARD_D4").withDeploymentConfiguration(new DeploymentConfiguration().withVirtualMachineConfiguration(new VirtualMachineConfiguration().withImageReference(new ImageReference().withId("/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1")).withNodeAgentSkuId("batch.node.ubuntu 18.04"))).withNetworkConfiguration(new NetworkConfiguration().withSubnetId("/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123").withPublicIpAddressConfiguration(new PublicIpAddressConfiguration().withProvision(IpAddressProvisioningType.NO_PUBLIC_IPADDRESSES))).create(); + manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct") + .withVmSize("STANDARD_D4") + .withDeploymentConfiguration(new DeploymentConfiguration().withVirtualMachineConfiguration( + new VirtualMachineConfiguration().withImageReference(new ImageReference().withId( + "/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1")) + .withNodeAgentSkuId("batch.node.ubuntu 18.04"))) + .withNetworkConfiguration(new NetworkConfiguration().withSubnetId( + "/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123") + .withPublicIpAddressConfiguration( + new PublicIpAddressConfiguration().withProvision(IpAddressProvisioningType.NO_PUBLIC_IPADDRESSES))) + .create(); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_ResourceTags.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolCreate_ResourceTags.json */ /** * Sample code: CreatePool - ResourceTags. @@ -1153,11 +1520,21 @@ public final class PoolCreateSamples { * @param manager Entry point to BatchManager. */ public static void createPoolResourceTags(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withVmSize("Standard_d4s_v3").withDeploymentConfiguration(new DeploymentConfiguration().withVirtualMachineConfiguration(new VirtualMachineConfiguration().withImageReference(new ImageReference().withPublisher("Canonical").withOffer("UbuntuServer").withSku("18_04-lts-gen2").withVersion("latest")).withNodeAgentSkuId("batch.node.ubuntu 18.04"))).withScaleSettings(new ScaleSettings().withFixedScale(new FixedScaleSettings().withTargetDedicatedNodes(1).withTargetLowPriorityNodes(0))).withResourceTags(mapOf("TagName1", "TagValue1", "TagName2", "TagValue2")).create(); + manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct") + .withVmSize("Standard_d4s_v3") + .withDeploymentConfiguration( + new DeploymentConfiguration().withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withImageReference(new ImageReference().withPublisher("Canonical").withOffer("UbuntuServer") + .withSku("18_04-lts-gen2").withVersion("latest")) + .withNodeAgentSkuId("batch.node.ubuntu 18.04"))) + .withScaleSettings(new ScaleSettings() + .withFixedScale(new FixedScaleSettings().withTargetDedicatedNodes(1).withTargetLowPriorityNodes(0))) + .withResourceTags(mapOf("TagName1", "TagValue1", "TagName2", "TagValue2")).create(); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_PublicIPs.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolCreate_PublicIPs.json */ /** * Sample code: CreatePool - Public IPs. @@ -1165,7 +1542,19 @@ public final class PoolCreateSamples { * @param manager Entry point to BatchManager. */ public static void createPoolPublicIPs(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct").withVmSize("STANDARD_D4").withDeploymentConfiguration(new DeploymentConfiguration().withVirtualMachineConfiguration(new VirtualMachineConfiguration().withImageReference(new ImageReference().withId("/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1")).withNodeAgentSkuId("batch.node.ubuntu 18.04"))).withNetworkConfiguration(new NetworkConfiguration().withSubnetId("/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123").withPublicIpAddressConfiguration(new PublicIpAddressConfiguration().withProvision(IpAddressProvisioningType.USER_MANAGED).withIpAddressIds(Arrays.asList("/subscriptions/subid1/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135")))).create(); + manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct") + .withVmSize("STANDARD_D4") + .withDeploymentConfiguration(new DeploymentConfiguration().withVirtualMachineConfiguration( + new VirtualMachineConfiguration().withImageReference(new ImageReference().withId( + "/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1")) + .withNodeAgentSkuId("batch.node.ubuntu 18.04"))) + .withNetworkConfiguration(new NetworkConfiguration().withSubnetId( + "/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123") + .withPublicIpAddressConfiguration(new PublicIpAddressConfiguration() + .withProvision(IpAddressProvisioningType.USER_MANAGED) + .withIpAddressIds(Arrays.asList( + "/subscriptions/subid1/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135")))) + .create(); } // Use "Map.of" if available @@ -1190,7 +1579,8 @@ public final class PoolCreateSamples { */ public final class PoolDeleteSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolDelete.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolDelete.json */ /** * Sample code: DeletePool. @@ -1198,7 +1588,8 @@ public final class PoolDeleteSamples { * @param manager Entry point to BatchManager. */ public static void deletePool(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().delete("default-azurebatch-japaneast", "sampleacct", "testpool", com.azure.core.util.Context.NONE); + manager.pools().delete("default-azurebatch-japaneast", "sampleacct", "testpool", + com.azure.core.util.Context.NONE); } } ``` @@ -1211,7 +1602,8 @@ public final class PoolDeleteSamples { */ public final class PoolDisableAutoScaleSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolDisableAutoScale.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolDisableAutoScale.json */ /** * Sample code: Disable AutoScale. @@ -1219,7 +1611,8 @@ public final class PoolDisableAutoScaleSamples { * @param manager Entry point to BatchManager. */ public static void disableAutoScale(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().disableAutoScaleWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", com.azure.core.util.Context.NONE); + manager.pools().disableAutoScaleWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", + com.azure.core.util.Context.NONE); } } ``` @@ -1232,7 +1625,8 @@ public final class PoolDisableAutoScaleSamples { */ public final class PoolGetSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolGet_SecurityProfile.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolGet_SecurityProfile.json */ /** * Sample code: GetPool - SecurityProfile. @@ -1240,23 +1634,28 @@ public final class PoolGetSamples { * @param manager Entry point to BatchManager. */ public static void getPoolSecurityProfile(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", com.azure.core.util.Context.NONE); + manager.pools().getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolGet_VirtualMachineConfiguration_Extensions.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ + * PoolGet_VirtualMachineConfiguration_Extensions.json */ /** * Sample code: GetPool - VirtualMachineConfiguration Extensions. * * @param manager Entry point to BatchManager. */ - public static void getPoolVirtualMachineConfigurationExtensions(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", com.azure.core.util.Context.NONE); + public static void + getPoolVirtualMachineConfigurationExtensions(com.azure.resourcemanager.batch.BatchManager manager) { + manager.pools().getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolGet_VirtualMachineConfiguration_MangedOSDisk.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ + * PoolGet_VirtualMachineConfiguration_MangedOSDisk.json */ /** * Sample code: GetPool - VirtualMachineConfiguration OSDisk. @@ -1264,23 +1663,43 @@ public final class PoolGetSamples { * @param manager Entry point to BatchManager. */ public static void getPoolVirtualMachineConfigurationOSDisk(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", com.azure.core.util.Context.NONE); + manager.pools().getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolGet_UpgradePolicy.json + */ + /** + * Sample code: GetPool - UpgradePolicy. + * + * @param manager Entry point to BatchManager. + */ + public static void getPoolUpgradePolicy(com.azure.resourcemanager.batch.BatchManager manager) { + manager.pools().getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolGet_VirtualMachineConfiguration_ServiceArtifactReference.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ + * PoolGet_VirtualMachineConfiguration_ServiceArtifactReference.json */ /** * Sample code: GetPool - VirtualMachineConfiguration ServiceArtifactReference. * * @param manager Entry point to BatchManager. */ - public static void getPoolVirtualMachineConfigurationServiceArtifactReference(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", com.azure.core.util.Context.NONE); + public static void getPoolVirtualMachineConfigurationServiceArtifactReference( + com.azure.resourcemanager.batch.BatchManager manager) { + manager.pools().getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolGet_AcceleratedNetworking.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolGet_AcceleratedNetworking. + * json */ /** * Sample code: GetPool - AcceleratedNetworking. @@ -1288,11 +1707,12 @@ public final class PoolGetSamples { * @param manager Entry point to BatchManager. */ public static void getPoolAcceleratedNetworking(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", com.azure.core.util.Context.NONE); + manager.pools().getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolGet.json */ /** * Sample code: GetPool. @@ -1300,7 +1720,8 @@ public final class PoolGetSamples { * @param manager Entry point to BatchManager. */ public static void getPool(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", com.azure.core.util.Context.NONE); + manager.pools().getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", + com.azure.core.util.Context.NONE); } } ``` @@ -1313,7 +1734,7 @@ public final class PoolGetSamples { */ public final class PoolListByBatchAccountSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolList.json */ /** * Sample code: ListPool. @@ -1321,11 +1742,13 @@ public final class PoolListByBatchAccountSamples { * @param manager Entry point to BatchManager. */ public static void listPool(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().listByBatchAccount("default-azurebatch-japaneast", "sampleacct", null, null, null, com.azure.core.util.Context.NONE); + manager.pools().listByBatchAccount("default-azurebatch-japaneast", "sampleacct", null, null, null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolListWithFilter.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolListWithFilter.json */ /** * Sample code: ListPoolWithFilter. @@ -1333,7 +1756,10 @@ public final class PoolListByBatchAccountSamples { * @param manager Entry point to BatchManager. */ public static void listPoolWithFilter(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().listByBatchAccount("default-azurebatch-japaneast", "sampleacct", 50, "properties/allocationState,properties/provisioningStateTransitionTime,properties/currentDedicatedNodes,properties/currentLowPriorityNodes", "startswith(name, 'po') or (properties/allocationState eq 'Steady' and properties/provisioningStateTransitionTime lt datetime'2017-02-02')", com.azure.core.util.Context.NONE); + manager.pools().listByBatchAccount("default-azurebatch-japaneast", "sampleacct", 50, + "properties/allocationState,properties/provisioningStateTransitionTime,properties/currentDedicatedNodes,properties/currentLowPriorityNodes", + "startswith(name, 'po') or (properties/allocationState eq 'Steady' and properties/provisioningStateTransitionTime lt datetime'2017-02-02')", + com.azure.core.util.Context.NONE); } } ``` @@ -1346,7 +1772,8 @@ public final class PoolListByBatchAccountSamples { */ public final class PoolStopResizeSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolStopResize.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolStopResize.json */ /** * Sample code: StopPoolResize. @@ -1354,7 +1781,8 @@ public final class PoolStopResizeSamples { * @param manager Entry point to BatchManager. */ public static void stopPoolResize(com.azure.resourcemanager.batch.BatchManager manager) { - manager.pools().stopResizeWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", com.azure.core.util.Context.NONE); + manager.pools().stopResizeWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", + com.azure.core.util.Context.NONE); } } ``` @@ -1375,14 +1803,14 @@ import com.azure.resourcemanager.batch.models.ScaleSettings; import com.azure.resourcemanager.batch.models.StartTask; import java.time.Duration; import java.util.Arrays; -import java.util.stream.Collectors; /** * Samples for Pool Update. */ public final class PoolUpdateSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolUpdate_EnableAutoScale.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolUpdate_EnableAutoScale.json */ /** * Sample code: UpdatePool - Enable Autoscale. @@ -1390,12 +1818,18 @@ public final class PoolUpdateSamples { * @param manager Entry point to BatchManager. */ public static void updatePoolEnableAutoscale(com.azure.resourcemanager.batch.BatchManager manager) { - Pool resource = manager.pools().getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", com.azure.core.util.Context.NONE).getValue(); - resource.update().withScaleSettings(new ScaleSettings().withAutoScale(new AutoScaleSettings().withFormula("$TargetDedicatedNodes=34"))).apply(); + Pool resource = manager.pools() + .getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withScaleSettings( + new ScaleSettings().withAutoScale(new AutoScaleSettings().withFormula("$TargetDedicatedNodes=34"))) + .apply(); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolUpdate_RemoveStartTask.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolUpdate_RemoveStartTask.json */ /** * Sample code: UpdatePool - Remove Start Task. @@ -1403,12 +1837,15 @@ public final class PoolUpdateSamples { * @param manager Entry point to BatchManager. */ public static void updatePoolRemoveStartTask(com.azure.resourcemanager.batch.BatchManager manager) { - Pool resource = manager.pools().getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", com.azure.core.util.Context.NONE).getValue(); + Pool resource = manager.pools() + .getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", com.azure.core.util.Context.NONE) + .getValue(); resource.update().withStartTask(new StartTask()).apply(); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolUpdate_ResizePool.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolUpdate_ResizePool.json */ /** * Sample code: UpdatePool - Resize Pool. @@ -1416,12 +1853,19 @@ public final class PoolUpdateSamples { * @param manager Entry point to BatchManager. */ public static void updatePoolResizePool(com.azure.resourcemanager.batch.BatchManager manager) { - Pool resource = manager.pools().getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", com.azure.core.util.Context.NONE).getValue(); - resource.update().withScaleSettings(new ScaleSettings().withFixedScale(new FixedScaleSettings().withResizeTimeout(Duration.parse("PT8M")).withTargetDedicatedNodes(5).withTargetLowPriorityNodes(0).withNodeDeallocationOption(ComputeNodeDeallocationOption.TASK_COMPLETION))).apply(); + Pool resource = manager.pools() + .getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withScaleSettings(new ScaleSettings().withFixedScale(new FixedScaleSettings() + .withResizeTimeout(Duration.parse("PT8M")).withTargetDedicatedNodes(5).withTargetLowPriorityNodes(0) + .withNodeDeallocationOption(ComputeNodeDeallocationOption.TASK_COMPLETION))) + .apply(); } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolUpdate_OtherProperties.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolUpdate_OtherProperties.json */ /** * Sample code: UpdatePool - Other Properties. @@ -1429,8 +1873,19 @@ public final class PoolUpdateSamples { * @param manager Entry point to BatchManager. */ public static void updatePoolOtherProperties(com.azure.resourcemanager.batch.BatchManager manager) { - Pool resource = manager.pools().getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", com.azure.core.util.Context.NONE).getValue(); - resource.update().withMetadata(Arrays.asList(new MetadataItem().withName("key1").withValue("value1"))).withCertificates(Arrays.asList(new CertificateReference().withId("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/certificates/sha1-1234567").withStoreLocation(CertificateStoreLocation.LOCAL_MACHINE).withStoreName("MY"))).withApplicationPackages(Arrays.asList(new ApplicationPackageReference().withId("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_1234"), new ApplicationPackageReference().withId("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_5678").withVersion("1.0"))).withTargetNodeCommunicationMode(NodeCommunicationMode.SIMPLIFIED).apply(); + Pool resource = manager.pools() + .getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().withMetadata(Arrays.asList(new MetadataItem().withName("key1").withValue("value1"))) + .withCertificates(Arrays.asList(new CertificateReference().withId( + "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/certificates/sha1-1234567") + .withStoreLocation(CertificateStoreLocation.LOCAL_MACHINE).withStoreName("MY"))) + .withApplicationPackages(Arrays.asList(new ApplicationPackageReference().withId( + "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_1234"), + new ApplicationPackageReference().withId( + "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_5678") + .withVersion("1.0"))) + .withTargetNodeCommunicationMode(NodeCommunicationMode.SIMPLIFIED).apply(); } } ``` @@ -1443,7 +1898,9 @@ public final class PoolUpdateSamples { */ public final class PrivateEndpointConnectionDeleteSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PrivateEndpointConnectionDelete.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateEndpointConnectionDelete. + * json */ /** * Sample code: PrivateEndpointConnectionDelete. @@ -1451,7 +1908,9 @@ public final class PrivateEndpointConnectionDeleteSamples { * @param manager Entry point to BatchManager. */ public static void privateEndpointConnectionDelete(com.azure.resourcemanager.batch.BatchManager manager) { - manager.privateEndpointConnections().delete("default-azurebatch-japaneast", "sampleacct", "testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0", com.azure.core.util.Context.NONE); + manager.privateEndpointConnections().delete("default-azurebatch-japaneast", "sampleacct", + "testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0", + com.azure.core.util.Context.NONE); } } ``` @@ -1464,7 +1923,8 @@ public final class PrivateEndpointConnectionDeleteSamples { */ public final class PrivateEndpointConnectionGetSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PrivateEndpointConnectionGet.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateEndpointConnectionGet.json */ /** * Sample code: GetPrivateEndpointConnection. @@ -1472,7 +1932,9 @@ public final class PrivateEndpointConnectionGetSamples { * @param manager Entry point to BatchManager. */ public static void getPrivateEndpointConnection(com.azure.resourcemanager.batch.BatchManager manager) { - manager.privateEndpointConnections().getWithResponse("default-azurebatch-japaneast", "sampleacct", "testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0", com.azure.core.util.Context.NONE); + manager.privateEndpointConnections().getWithResponse("default-azurebatch-japaneast", "sampleacct", + "testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0", + com.azure.core.util.Context.NONE); } } ``` @@ -1485,7 +1947,9 @@ public final class PrivateEndpointConnectionGetSamples { */ public final class PrivateEndpointConnectionListByBatchAccountSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PrivateEndpointConnectionsList.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateEndpointConnectionsList. + * json */ /** * Sample code: ListPrivateEndpointConnections. @@ -1493,7 +1957,8 @@ public final class PrivateEndpointConnectionListByBatchAccountSamples { * @param manager Entry point to BatchManager. */ public static void listPrivateEndpointConnections(com.azure.resourcemanager.batch.BatchManager manager) { - manager.privateEndpointConnections().listByBatchAccount("default-azurebatch-japaneast", "sampleacct", null, com.azure.core.util.Context.NONE); + manager.privateEndpointConnections().listByBatchAccount("default-azurebatch-japaneast", "sampleacct", null, + com.azure.core.util.Context.NONE); } } ``` @@ -1504,14 +1969,15 @@ public final class PrivateEndpointConnectionListByBatchAccountSamples { import com.azure.resourcemanager.batch.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.batch.models.PrivateLinkServiceConnectionState; import com.azure.resourcemanager.batch.models.PrivateLinkServiceConnectionStatus; -import java.util.stream.Collectors; /** * Samples for PrivateEndpointConnection Update. */ public final class PrivateEndpointConnectionUpdateSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PrivateEndpointConnectionUpdate.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateEndpointConnectionUpdate. + * json */ /** * Sample code: UpdatePrivateEndpointConnection. @@ -1519,7 +1985,12 @@ public final class PrivateEndpointConnectionUpdateSamples { * @param manager Entry point to BatchManager. */ public static void updatePrivateEndpointConnection(com.azure.resourcemanager.batch.BatchManager manager) { - manager.privateEndpointConnections().update("default-azurebatch-japaneast", "sampleacct", "testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0", new PrivateEndpointConnectionInner().withPrivateLinkServiceConnectionState(new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.APPROVED).withDescription("Approved by xyz.abc@company.com")), null, com.azure.core.util.Context.NONE); + manager.privateEndpointConnections().update("default-azurebatch-japaneast", "sampleacct", + "testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0", + new PrivateEndpointConnectionInner().withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.APPROVED) + .withDescription("Approved by xyz.abc@company.com")), + null, com.azure.core.util.Context.NONE); } } ``` @@ -1532,7 +2003,8 @@ public final class PrivateEndpointConnectionUpdateSamples { */ public final class PrivateLinkResourceGetSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PrivateLinkResourceGet.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateLinkResourceGet.json */ /** * Sample code: GetPrivateLinkResource. @@ -1540,7 +2012,8 @@ public final class PrivateLinkResourceGetSamples { * @param manager Entry point to BatchManager. */ public static void getPrivateLinkResource(com.azure.resourcemanager.batch.BatchManager manager) { - manager.privateLinkResources().getWithResponse("default-azurebatch-japaneast", "sampleacct", "batchAccount", com.azure.core.util.Context.NONE); + manager.privateLinkResources().getWithResponse("default-azurebatch-japaneast", "sampleacct", "batchAccount", + com.azure.core.util.Context.NONE); } } ``` @@ -1553,7 +2026,8 @@ public final class PrivateLinkResourceGetSamples { */ public final class PrivateLinkResourceListByBatchAccountSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PrivateLinkResourcesList.json + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateLinkResourcesList.json */ /** * Sample code: ListPrivateLinkResource. @@ -1561,7 +2035,8 @@ public final class PrivateLinkResourceListByBatchAccountSamples { * @param manager Entry point to BatchManager. */ public static void listPrivateLinkResource(com.azure.resourcemanager.batch.BatchManager manager) { - manager.privateLinkResources().listByBatchAccount("default-azurebatch-japaneast", "sampleacct", null, com.azure.core.util.Context.NONE); + manager.privateLinkResources().listByBatchAccount("default-azurebatch-japaneast", "sampleacct", null, + com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/batch/azure-resourcemanager-batch/pom.xml b/sdk/batch/azure-resourcemanager-batch/pom.xml index 1dd3584e5f069..483f97dd1cbc5 100644 --- a/sdk/batch/azure-resourcemanager-batch/pom.xml +++ b/sdk/batch/azure-resourcemanager-batch/pom.xml @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-batch - 1.1.0-beta.4 + 1.1.0-beta.5 jar Microsoft Azure SDK for Batch Management - This package contains Microsoft Azure SDK for Batch Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Batch Client. Package tag package-2023-11. + This package contains Microsoft Azure SDK for Batch Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Batch Client. Package tag package-2024-02. https://github.com/Azure/azure-sdk-for-java @@ -88,8 +88,6 @@ 4.11.0 test - - net.bytebuddy byte-buddy diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/BatchManager.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/BatchManager.java index 967c18cbf3cff..44e9afc66c17a 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/BatchManager.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/BatchManager.java @@ -232,7 +232,7 @@ public BatchManager authenticate(TokenCredential credential, AzureProfile profil StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.batch").append("/") - .append("1.1.0-beta.3"); + .append("1.1.0-beta.4"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (").append(Configuration.getGlobalConfiguration().get("java.version")) .append("; ").append(Configuration.getGlobalConfiguration().get("os.name")).append("; ") diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/fluent/models/PoolInner.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/fluent/models/PoolInner.java index 859c9eb66fefe..e14b5c0d97a2d 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/fluent/models/PoolInner.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/fluent/models/PoolInner.java @@ -22,6 +22,7 @@ import com.azure.resourcemanager.batch.models.ScaleSettings; import com.azure.resourcemanager.batch.models.StartTask; import com.azure.resourcemanager.batch.models.TaskSchedulingPolicy; +import com.azure.resourcemanager.batch.models.UpgradePolicy; import com.azure.resourcemanager.batch.models.UserAccount; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -684,6 +685,29 @@ public NodeCommunicationMode currentNodeCommunicationMode() { return this.innerProperties() == null ? null : this.innerProperties().currentNodeCommunicationMode(); } + /** + * Get the upgradePolicy property: Describes an upgrade policy - automatic, manual, or rolling. + * + * @return the upgradePolicy value. + */ + public UpgradePolicy upgradePolicy() { + return this.innerProperties() == null ? null : this.innerProperties().upgradePolicy(); + } + + /** + * Set the upgradePolicy property: Describes an upgrade policy - automatic, manual, or rolling. + * + * @param upgradePolicy the upgradePolicy value to set. + * @return the PoolInner object itself. + */ + public PoolInner withUpgradePolicy(UpgradePolicy upgradePolicy) { + if (this.innerProperties() == null) { + this.innerProperties = new PoolProperties(); + } + this.innerProperties().withUpgradePolicy(upgradePolicy); + return this; + } + /** * Get the resourceTags property: The user-defined tags to be associated with the Azure Batch Pool. When specified, * these tags are propagated to the backing Azure resources associated with the pool. This property can only be diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/fluent/models/PoolProperties.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/fluent/models/PoolProperties.java index 30e881d4035b8..3cf497e8b7ed4 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/fluent/models/PoolProperties.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/fluent/models/PoolProperties.java @@ -20,6 +20,7 @@ import com.azure.resourcemanager.batch.models.ScaleSettings; import com.azure.resourcemanager.batch.models.StartTask; import com.azure.resourcemanager.batch.models.TaskSchedulingPolicy; +import com.azure.resourcemanager.batch.models.UpgradePolicy; import com.azure.resourcemanager.batch.models.UserAccount; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -256,6 +257,12 @@ public final class PoolProperties { @JsonProperty(value = "currentNodeCommunicationMode", access = JsonProperty.Access.WRITE_ONLY) private NodeCommunicationMode currentNodeCommunicationMode; + /* + * Describes an upgrade policy - automatic, manual, or rolling. + */ + @JsonProperty(value = "upgradePolicy") + private UpgradePolicy upgradePolicy; + /* * The user-defined tags to be associated with the Azure Batch Pool. When specified, these tags are propagated to * the backing Azure resources associated with the pool. This property can only be specified when the Batch account @@ -812,6 +819,26 @@ public NodeCommunicationMode currentNodeCommunicationMode() { return this.currentNodeCommunicationMode; } + /** + * Get the upgradePolicy property: Describes an upgrade policy - automatic, manual, or rolling. + * + * @return the upgradePolicy value. + */ + public UpgradePolicy upgradePolicy() { + return this.upgradePolicy; + } + + /** + * Set the upgradePolicy property: Describes an upgrade policy - automatic, manual, or rolling. + * + * @param upgradePolicy the upgradePolicy value to set. + * @return the PoolProperties object itself. + */ + public PoolProperties withUpgradePolicy(UpgradePolicy upgradePolicy) { + this.upgradePolicy = upgradePolicy; + return this; + } + /** * Get the resourceTags property: The user-defined tags to be associated with the Azure Batch Pool. When specified, * these tags are propagated to the backing Azure resources associated with the pool. This property can only be @@ -878,5 +905,8 @@ public void validate() { if (mountConfiguration() != null) { mountConfiguration().forEach(e -> e.validate()); } + if (upgradePolicy() != null) { + upgradePolicy().validate(); + } } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/fluent/models/SupportedSkuInner.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/fluent/models/SupportedSkuInner.java index 9f6c68567eda2..7653f77443b16 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/fluent/models/SupportedSkuInner.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/fluent/models/SupportedSkuInner.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Immutable; import com.azure.resourcemanager.batch.models.SkuCapability; import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; import java.util.List; /** @@ -32,6 +33,12 @@ public final class SupportedSkuInner { @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) private List capabilities; + /* + * The time when Azure Batch service will retire this SKU. + */ + @JsonProperty(value = "batchSupportEndOfLife", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime batchSupportEndOfLife; + /** * Creates an instance of SupportedSkuInner class. */ @@ -65,6 +72,15 @@ public List capabilities() { return this.capabilities; } + /** + * Get the batchSupportEndOfLife property: The time when Azure Batch service will retire this SKU. + * + * @return the batchSupportEndOfLife value. + */ + public OffsetDateTime batchSupportEndOfLife() { + return this.batchSupportEndOfLife; + } + /** * Validates the instance. * diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/ApplicationImpl.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/ApplicationImpl.java index 951a5c31d7791..e12cda1fd8e16 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/ApplicationImpl.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/ApplicationImpl.java @@ -104,9 +104,9 @@ public Application apply(Context context) { ApplicationImpl(ApplicationInner innerObject, com.azure.resourcemanager.batch.BatchManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = Utils.getValueFromIdByName(innerObject.id(), "batchAccounts"); - this.applicationName = Utils.getValueFromIdByName(innerObject.id(), "applications"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "batchAccounts"); + this.applicationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "applications"); } public Application refresh() { diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/ApplicationPackagesImpl.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/ApplicationPackagesImpl.java index 6e4f82e27ebe0..97b9f417b1122 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/ApplicationPackagesImpl.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/ApplicationPackagesImpl.java @@ -88,33 +88,33 @@ public PagedIterable list(String resourceGroupName, String a String applicationName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, applicationName); - return Utils.mapPage(inner, inner1 -> new ApplicationPackageImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationPackageImpl(inner1, this.manager())); } public PagedIterable list(String resourceGroupName, String accountName, String applicationName, Integer maxresults, Context context) { PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, applicationName, maxresults, context); - return Utils.mapPage(inner, inner1 -> new ApplicationPackageImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationPackageImpl(inner1, this.manager())); } public ApplicationPackage getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); } - String applicationName = Utils.getValueFromIdByName(id, "applications"); + String applicationName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); if (applicationName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); } - String versionName = Utils.getValueFromIdByName(id, "versions"); + String versionName = ResourceManagerUtils.getValueFromIdByName(id, "versions"); if (versionName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); @@ -124,22 +124,22 @@ public ApplicationPackage getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); } - String applicationName = Utils.getValueFromIdByName(id, "applications"); + String applicationName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); if (applicationName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); } - String versionName = Utils.getValueFromIdByName(id, "versions"); + String versionName = ResourceManagerUtils.getValueFromIdByName(id, "versions"); if (versionName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); @@ -148,22 +148,22 @@ public Response getByIdWithResponse(String id, Context conte } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); } - String applicationName = Utils.getValueFromIdByName(id, "applications"); + String applicationName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); if (applicationName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); } - String versionName = Utils.getValueFromIdByName(id, "versions"); + String versionName = ResourceManagerUtils.getValueFromIdByName(id, "versions"); if (versionName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); @@ -172,22 +172,22 @@ public void deleteById(String id) { } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); } - String applicationName = Utils.getValueFromIdByName(id, "applications"); + String applicationName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); if (applicationName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); } - String versionName = Utils.getValueFromIdByName(id, "versions"); + String versionName = ResourceManagerUtils.getValueFromIdByName(id, "versions"); if (versionName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'versions'.", id))); diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/ApplicationsImpl.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/ApplicationsImpl.java index cdb4c6cbe2e2c..221e7244875f9 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/ApplicationsImpl.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/ApplicationsImpl.java @@ -59,28 +59,28 @@ public Application get(String resourceGroupName, String accountName, String appl public PagedIterable list(String resourceGroupName, String accountName) { PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName); - return Utils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); } public PagedIterable list(String resourceGroupName, String accountName, Integer maxresults, Context context) { PagedIterable inner = this.serviceClient().list(resourceGroupName, accountName, maxresults, context); - return Utils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); } public Application getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); } - String applicationName = Utils.getValueFromIdByName(id, "applications"); + String applicationName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); if (applicationName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); @@ -89,17 +89,17 @@ public Application getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); } - String applicationName = Utils.getValueFromIdByName(id, "applications"); + String applicationName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); if (applicationName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); @@ -108,17 +108,17 @@ public Response getByIdWithResponse(String id, Context context) { } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); } - String applicationName = Utils.getValueFromIdByName(id, "applications"); + String applicationName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); if (applicationName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); @@ -127,17 +127,17 @@ public void deleteById(String id) { } public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); } - String applicationName = Utils.getValueFromIdByName(id, "applications"); + String applicationName = ResourceManagerUtils.getValueFromIdByName(id, "applications"); if (applicationName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/BatchAccountImpl.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/BatchAccountImpl.java index 062eb68393016..2e156870c1025 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/BatchAccountImpl.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/BatchAccountImpl.java @@ -221,8 +221,8 @@ public BatchAccount apply(Context context) { BatchAccountImpl(BatchAccountInner innerObject, com.azure.resourcemanager.batch.BatchManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = Utils.getValueFromIdByName(innerObject.id(), "batchAccounts"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "batchAccounts"); } public BatchAccount refresh() { diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/BatchAccountsImpl.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/BatchAccountsImpl.java index d3a046a9e85a5..d232d54743697 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/BatchAccountsImpl.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/BatchAccountsImpl.java @@ -65,22 +65,22 @@ public BatchAccount getByResourceGroup(String resourceGroupName, String accountN public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new BatchAccountImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BatchAccountImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new BatchAccountImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BatchAccountImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new BatchAccountImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BatchAccountImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new BatchAccountImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BatchAccountImpl(inner1, this.manager())); } public Response synchronizeAutoStorageKeysWithResponse(String resourceGroupName, String accountName, @@ -137,14 +137,14 @@ public BatchAccountKeys getKeys(String resourceGroupName, String accountName) { public PagedIterable listDetectors(String resourceGroupName, String accountName) { PagedIterable inner = this.serviceClient().listDetectors(resourceGroupName, accountName); - return Utils.mapPage(inner, inner1 -> new DetectorResponseImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DetectorResponseImpl(inner1, this.manager())); } public PagedIterable listDetectors(String resourceGroupName, String accountName, Context context) { PagedIterable inner = this.serviceClient().listDetectors(resourceGroupName, accountName, context); - return Utils.mapPage(inner, inner1 -> new DetectorResponseImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DetectorResponseImpl(inner1, this.manager())); } public Response getDetectorWithResponse(String resourceGroupName, String accountName, @@ -172,23 +172,25 @@ public PagedIterable listOutboundNetworkDependencie String accountName) { PagedIterable inner = this.serviceClient().listOutboundNetworkDependenciesEndpoints(resourceGroupName, accountName); - return Utils.mapPage(inner, inner1 -> new OutboundEnvironmentEndpointImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new OutboundEnvironmentEndpointImpl(inner1, this.manager())); } public PagedIterable listOutboundNetworkDependenciesEndpoints(String resourceGroupName, String accountName, Context context) { PagedIterable inner = this.serviceClient().listOutboundNetworkDependenciesEndpoints(resourceGroupName, accountName, context); - return Utils.mapPage(inner, inner1 -> new OutboundEnvironmentEndpointImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new OutboundEnvironmentEndpointImpl(inner1, this.manager())); } public BatchAccount getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); @@ -197,12 +199,12 @@ public BatchAccount getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); @@ -211,12 +213,12 @@ public Response getByIdWithResponse(String id, Context context) { } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); @@ -225,12 +227,12 @@ public void deleteById(String id) { } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/BatchManagementClientImpl.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/BatchManagementClientImpl.java index 948a6a1284da3..dc425322e44e6 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/BatchManagementClientImpl.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/BatchManagementClientImpl.java @@ -274,7 +274,7 @@ public PoolsClient getPools() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-11-01"; + this.apiVersion = "2024-02-01"; this.batchAccounts = new BatchAccountsClientImpl(this); this.applicationPackages = new ApplicationPackagesClientImpl(this); this.applications = new ApplicationsClientImpl(this); diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/CertificateImpl.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/CertificateImpl.java index ee3685216e0f6..f8b5492f47af1 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/CertificateImpl.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/CertificateImpl.java @@ -147,9 +147,9 @@ public Certificate apply(Context context) { CertificateImpl(CertificateInner innerObject, com.azure.resourcemanager.batch.BatchManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = Utils.getValueFromIdByName(innerObject.id(), "batchAccounts"); - this.certificateName = Utils.getValueFromIdByName(innerObject.id(), "certificates"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "batchAccounts"); + this.certificateName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "certificates"); } public Certificate refresh() { diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/CertificatesImpl.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/CertificatesImpl.java index ec7723eb233a8..f8a926a5636b7 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/CertificatesImpl.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/CertificatesImpl.java @@ -31,14 +31,14 @@ public CertificatesImpl(CertificatesClient innerClient, public PagedIterable listByBatchAccount(String resourceGroupName, String accountName) { PagedIterable inner = this.serviceClient().listByBatchAccount(resourceGroupName, accountName); - return Utils.mapPage(inner, inner1 -> new CertificateImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CertificateImpl(inner1, this.manager())); } public PagedIterable listByBatchAccount(String resourceGroupName, String accountName, Integer maxresults, String select, String filter, Context context) { PagedIterable inner = this.serviceClient().listByBatchAccount(resourceGroupName, accountName, maxresults, select, filter, context); - return Utils.mapPage(inner, inner1 -> new CertificateImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CertificateImpl(inner1, this.manager())); } public void delete(String resourceGroupName, String accountName, String certificateName) { @@ -92,17 +92,17 @@ public Certificate cancelDeletion(String resourceGroupName, String accountName, } public Certificate getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); } - String certificateName = Utils.getValueFromIdByName(id, "certificates"); + String certificateName = ResourceManagerUtils.getValueFromIdByName(id, "certificates"); if (certificateName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); @@ -111,17 +111,17 @@ public Certificate getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); } - String certificateName = Utils.getValueFromIdByName(id, "certificates"); + String certificateName = ResourceManagerUtils.getValueFromIdByName(id, "certificates"); if (certificateName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); @@ -130,17 +130,17 @@ public Response getByIdWithResponse(String id, Context context) { } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); } - String certificateName = Utils.getValueFromIdByName(id, "certificates"); + String certificateName = ResourceManagerUtils.getValueFromIdByName(id, "certificates"); if (certificateName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); @@ -149,17 +149,17 @@ public void deleteById(String id) { } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); } - String certificateName = Utils.getValueFromIdByName(id, "certificates"); + String certificateName = ResourceManagerUtils.getValueFromIdByName(id, "certificates"); if (certificateName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id))); diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/LocationsImpl.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/LocationsImpl.java index 37e7331e32a2b..46d0f835da714 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/LocationsImpl.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/LocationsImpl.java @@ -52,26 +52,26 @@ public BatchLocationQuota getQuotas(String locationName) { public PagedIterable listSupportedVirtualMachineSkus(String locationName) { PagedIterable inner = this.serviceClient().listSupportedVirtualMachineSkus(locationName); - return Utils.mapPage(inner, inner1 -> new SupportedSkuImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SupportedSkuImpl(inner1, this.manager())); } public PagedIterable listSupportedVirtualMachineSkus(String locationName, Integer maxresults, String filter, Context context) { PagedIterable inner = this.serviceClient().listSupportedVirtualMachineSkus(locationName, maxresults, filter, context); - return Utils.mapPage(inner, inner1 -> new SupportedSkuImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SupportedSkuImpl(inner1, this.manager())); } public PagedIterable listSupportedCloudServiceSkus(String locationName) { PagedIterable inner = this.serviceClient().listSupportedCloudServiceSkus(locationName); - return Utils.mapPage(inner, inner1 -> new SupportedSkuImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SupportedSkuImpl(inner1, this.manager())); } public PagedIterable listSupportedCloudServiceSkus(String locationName, Integer maxresults, String filter, Context context) { PagedIterable inner = this.serviceClient().listSupportedCloudServiceSkus(locationName, maxresults, filter, context); - return Utils.mapPage(inner, inner1 -> new SupportedSkuImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SupportedSkuImpl(inner1, this.manager())); } public Response checkNameAvailabilityWithResponse(String locationName, diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/OperationsImpl.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/OperationsImpl.java index 8a2c1788468ce..09bc2618980af 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/OperationsImpl.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/OperationsImpl.java @@ -26,12 +26,12 @@ public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.ba public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/PoolImpl.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/PoolImpl.java index 2d2ac3b6cfc2c..c0e593b45e43c 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/PoolImpl.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/PoolImpl.java @@ -24,6 +24,7 @@ import com.azure.resourcemanager.batch.models.ScaleSettings; import com.azure.resourcemanager.batch.models.StartTask; import com.azure.resourcemanager.batch.models.TaskSchedulingPolicy; +import com.azure.resourcemanager.batch.models.UpgradePolicy; import com.azure.resourcemanager.batch.models.UserAccount; import java.time.OffsetDateTime; import java.util.Collections; @@ -193,6 +194,10 @@ public NodeCommunicationMode currentNodeCommunicationMode() { return this.innerModel().currentNodeCommunicationMode(); } + public UpgradePolicy upgradePolicy() { + return this.innerModel().upgradePolicy(); + } + public Map resourceTags() { Map inner = this.innerModel().resourceTags(); if (inner != null) { @@ -273,9 +278,9 @@ public Pool apply(Context context) { PoolImpl(PoolInner innerObject, com.azure.resourcemanager.batch.BatchManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.accountName = Utils.getValueFromIdByName(innerObject.id(), "batchAccounts"); - this.poolName = Utils.getValueFromIdByName(innerObject.id(), "pools"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "batchAccounts"); + this.poolName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "pools"); } public Pool refresh() { @@ -391,6 +396,11 @@ public PoolImpl withTargetNodeCommunicationMode(NodeCommunicationMode targetNode return this; } + public PoolImpl withUpgradePolicy(UpgradePolicy upgradePolicy) { + this.innerModel().withUpgradePolicy(upgradePolicy); + return this; + } + public PoolImpl withResourceTags(Map resourceTags) { this.innerModel().withResourceTags(resourceTags); return this; diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/PoolsImpl.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/PoolsImpl.java index 3a9ebbcebcca9..05352143dee82 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/PoolsImpl.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/PoolsImpl.java @@ -31,14 +31,14 @@ public PoolsImpl(PoolsClient innerClient, com.azure.resourcemanager.batch.BatchM public PagedIterable listByBatchAccount(String resourceGroupName, String accountName) { PagedIterable inner = this.serviceClient().listByBatchAccount(resourceGroupName, accountName); - return Utils.mapPage(inner, inner1 -> new PoolImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PoolImpl(inner1, this.manager())); } public PagedIterable listByBatchAccount(String resourceGroupName, String accountName, Integer maxresults, String select, String filter, Context context) { PagedIterable inner = this.serviceClient().listByBatchAccount(resourceGroupName, accountName, maxresults, select, filter, context); - return Utils.mapPage(inner, inner1 -> new PoolImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PoolImpl(inner1, this.manager())); } public void delete(String resourceGroupName, String accountName, String poolName) { @@ -113,17 +113,17 @@ public Pool stopResize(String resourceGroupName, String accountName, String pool } public Pool getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); } - String poolName = Utils.getValueFromIdByName(id, "pools"); + String poolName = ResourceManagerUtils.getValueFromIdByName(id, "pools"); if (poolName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'pools'.", id))); @@ -132,17 +132,17 @@ public Pool getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); } - String poolName = Utils.getValueFromIdByName(id, "pools"); + String poolName = ResourceManagerUtils.getValueFromIdByName(id, "pools"); if (poolName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'pools'.", id))); @@ -151,17 +151,17 @@ public Response getByIdWithResponse(String id, Context context) { } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); } - String poolName = Utils.getValueFromIdByName(id, "pools"); + String poolName = ResourceManagerUtils.getValueFromIdByName(id, "pools"); if (poolName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'pools'.", id))); @@ -170,17 +170,17 @@ public void deleteById(String id) { } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String accountName = Utils.getValueFromIdByName(id, "batchAccounts"); + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "batchAccounts"); if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'batchAccounts'.", id))); } - String poolName = Utils.getValueFromIdByName(id, "pools"); + String poolName = ResourceManagerUtils.getValueFromIdByName(id, "pools"); if (poolName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'pools'.", id))); diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/PrivateEndpointConnectionsImpl.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/PrivateEndpointConnectionsImpl.java index efc34c57e5284..d406f5a15d860 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/PrivateEndpointConnectionsImpl.java @@ -30,14 +30,14 @@ public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClie public PagedIterable listByBatchAccount(String resourceGroupName, String accountName) { PagedIterable inner = this.serviceClient().listByBatchAccount(resourceGroupName, accountName); - return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); } public PagedIterable listByBatchAccount(String resourceGroupName, String accountName, Integer maxresults, Context context) { PagedIterable inner = this.serviceClient().listByBatchAccount(resourceGroupName, accountName, maxresults, context); - return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())); } public Response getWithResponse(String resourceGroupName, String accountName, diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/PrivateLinkResourcesImpl.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/PrivateLinkResourcesImpl.java index b310d6a4a11d4..7e2a729b812e3 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/PrivateLinkResourcesImpl.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/PrivateLinkResourcesImpl.java @@ -30,14 +30,14 @@ public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, public PagedIterable listByBatchAccount(String resourceGroupName, String accountName) { PagedIterable inner = this.serviceClient().listByBatchAccount(resourceGroupName, accountName); - return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } public PagedIterable listByBatchAccount(String resourceGroupName, String accountName, Integer maxresults, Context context) { PagedIterable inner = this.serviceClient().listByBatchAccount(resourceGroupName, accountName, maxresults, context); - return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); } public Response getWithResponse(String resourceGroupName, String accountName, diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/Utils.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/ResourceManagerUtils.java similarity index 99% rename from sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/Utils.java rename to sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/ResourceManagerUtils.java index 98c1d460a912c..b12b25795b245 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/Utils.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/ResourceManagerUtils.java @@ -19,8 +19,8 @@ import java.util.stream.Stream; import reactor.core.publisher.Flux; -final class Utils { - private Utils() { +final class ResourceManagerUtils { + private ResourceManagerUtils() { } static String getValueFromIdByName(String id, String name) { diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/SupportedSkuImpl.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/SupportedSkuImpl.java index adc5878d40ec5..bf6aa5f40b17b 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/SupportedSkuImpl.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/implementation/SupportedSkuImpl.java @@ -7,6 +7,7 @@ import com.azure.resourcemanager.batch.fluent.models.SupportedSkuInner; import com.azure.resourcemanager.batch.models.SkuCapability; import com.azure.resourcemanager.batch.models.SupportedSku; +import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; @@ -37,6 +38,10 @@ public List capabilities() { } } + public OffsetDateTime batchSupportEndOfLife() { + return this.innerModel().batchSupportEndOfLife(); + } + public SupportedSkuInner innerModel() { return this.innerObject; } diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/AutomaticOSUpgradePolicy.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/AutomaticOSUpgradePolicy.java new file mode 100644 index 0000000000000..3507367bbce78 --- /dev/null +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/AutomaticOSUpgradePolicy.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.batch.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The configuration parameters used for performing automatic OS upgrade. + */ +@Fluent +public final class AutomaticOSUpgradePolicy { + /* + * Whether OS image rollback feature should be disabled. + */ + @JsonProperty(value = "disableAutomaticRollback") + private Boolean disableAutomaticRollback; + + /* + * 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.

If this is set to true for Windows based pools, + * [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/en-us/rest/api/batchmanagement/pool/ + * create?tabs=HTTP#windowsconfiguration) + * cannot be set to true. + */ + @JsonProperty(value = "enableAutomaticOSUpgrade") + private Boolean enableAutomaticOSUpgrade; + + /* + * Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Auto OS Upgrade will fallback to + * the default policy if no policy is defined on the VMSS. + */ + @JsonProperty(value = "useRollingUpgradePolicy") + private Boolean useRollingUpgradePolicy; + + /* + * Defer OS upgrades on the TVMs if they are running tasks. + */ + @JsonProperty(value = "osRollingUpgradeDeferral") + private Boolean osRollingUpgradeDeferral; + + /** + * Creates an instance of AutomaticOSUpgradePolicy class. + */ + public AutomaticOSUpgradePolicy() { + } + + /** + * Get the disableAutomaticRollback property: Whether OS image rollback feature should be disabled. + * + * @return the disableAutomaticRollback value. + */ + public Boolean disableAutomaticRollback() { + return this.disableAutomaticRollback; + } + + /** + * Set the disableAutomaticRollback property: Whether OS image rollback feature should be disabled. + * + * @param disableAutomaticRollback the disableAutomaticRollback value to set. + * @return the AutomaticOSUpgradePolicy object itself. + */ + public AutomaticOSUpgradePolicy withDisableAutomaticRollback(Boolean disableAutomaticRollback) { + this.disableAutomaticRollback = disableAutomaticRollback; + return this; + } + + /** + * 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. <br + * /><br /> If this is set to true for Windows based pools, + * [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/en-us/rest/api/batchmanagement/pool/create?tabs=HTTP#windowsconfiguration) + * 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. <br + * /><br /> If this is set to true for Windows based pools, + * [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/en-us/rest/api/batchmanagement/pool/create?tabs=HTTP#windowsconfiguration) + * 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 useRollingUpgradePolicy property: Indicates whether rolling upgrade policy should be used during Auto OS + * Upgrade. Auto OS Upgrade will fallback to the default policy if no policy is defined on the VMSS. + * + * @return the useRollingUpgradePolicy value. + */ + public Boolean useRollingUpgradePolicy() { + return this.useRollingUpgradePolicy; + } + + /** + * Set the useRollingUpgradePolicy property: Indicates whether rolling upgrade policy should be used during Auto OS + * Upgrade. Auto OS Upgrade will fallback to the default policy if no policy is defined on the VMSS. + * + * @param useRollingUpgradePolicy the useRollingUpgradePolicy value to set. + * @return the AutomaticOSUpgradePolicy object itself. + */ + public AutomaticOSUpgradePolicy withUseRollingUpgradePolicy(Boolean useRollingUpgradePolicy) { + this.useRollingUpgradePolicy = useRollingUpgradePolicy; + return this; + } + + /** + * Get the osRollingUpgradeDeferral property: Defer OS upgrades on the TVMs if they are running tasks. + * + * @return the osRollingUpgradeDeferral value. + */ + public Boolean osRollingUpgradeDeferral() { + return this.osRollingUpgradeDeferral; + } + + /** + * Set the osRollingUpgradeDeferral property: Defer OS upgrades on the TVMs if they are running tasks. + * + * @param osRollingUpgradeDeferral the osRollingUpgradeDeferral value to set. + * @return the AutomaticOSUpgradePolicy object itself. + */ + public AutomaticOSUpgradePolicy withOsRollingUpgradeDeferral(Boolean osRollingUpgradeDeferral) { + this.osRollingUpgradeDeferral = osRollingUpgradeDeferral; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/Pool.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/Pool.java index a8b5f852c8f69..8493f4c442bb0 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/Pool.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/Pool.java @@ -304,6 +304,13 @@ public interface Pool { */ NodeCommunicationMode currentNodeCommunicationMode(); + /** + * Gets the upgradePolicy property: Describes an upgrade policy - automatic, manual, or rolling. + * + * @return the upgradePolicy value. + */ + UpgradePolicy upgradePolicy(); + /** * Gets the resourceTags property: The user-defined tags to be associated with the Azure Batch Pool. When specified, * these tags are propagated to the backing Azure resources associated with the pool. This property can only be @@ -369,8 +376,8 @@ interface WithCreate extends DefinitionStages.WithIdentity, DefinitionStages.Wit DefinitionStages.WithTaskSchedulingPolicy, DefinitionStages.WithUserAccounts, DefinitionStages.WithMetadata, DefinitionStages.WithStartTask, DefinitionStages.WithCertificates, DefinitionStages.WithApplicationPackages, DefinitionStages.WithApplicationLicenses, DefinitionStages.WithMountConfiguration, - DefinitionStages.WithTargetNodeCommunicationMode, DefinitionStages.WithResourceTags, - DefinitionStages.WithIfMatch, DefinitionStages.WithIfNoneMatch { + DefinitionStages.WithTargetNodeCommunicationMode, DefinitionStages.WithUpgradePolicy, + DefinitionStages.WithResourceTags, DefinitionStages.WithIfMatch, DefinitionStages.WithIfNoneMatch { /** * Executes the create request. * @@ -733,6 +740,19 @@ interface WithTargetNodeCommunicationMode { WithCreate withTargetNodeCommunicationMode(NodeCommunicationMode targetNodeCommunicationMode); } + /** + * The stage of the Pool definition allowing to specify upgradePolicy. + */ + interface WithUpgradePolicy { + /** + * Specifies the upgradePolicy property: Describes an upgrade policy - automatic, manual, or rolling.. + * + * @param upgradePolicy Describes an upgrade policy - automatic, manual, or rolling. + * @return the next definition stage. + */ + WithCreate withUpgradePolicy(UpgradePolicy upgradePolicy); + } + /** * The stage of the Pool definition allowing to specify resourceTags. */ @@ -800,7 +820,8 @@ interface Update extends UpdateStages.WithIdentity, UpdateStages.WithDisplayName UpdateStages.WithTaskSlotsPerNode, UpdateStages.WithTaskSchedulingPolicy, UpdateStages.WithUserAccounts, UpdateStages.WithMetadata, UpdateStages.WithStartTask, UpdateStages.WithCertificates, UpdateStages.WithApplicationPackages, UpdateStages.WithApplicationLicenses, UpdateStages.WithMountConfiguration, - UpdateStages.WithTargetNodeCommunicationMode, UpdateStages.WithResourceTags, UpdateStages.WithIfMatch { + UpdateStages.WithTargetNodeCommunicationMode, UpdateStages.WithUpgradePolicy, UpdateStages.WithResourceTags, + UpdateStages.WithIfMatch { /** * Executes the update request. * @@ -1167,6 +1188,19 @@ interface WithTargetNodeCommunicationMode { Update withTargetNodeCommunicationMode(NodeCommunicationMode targetNodeCommunicationMode); } + /** + * The stage of the Pool update allowing to specify upgradePolicy. + */ + interface WithUpgradePolicy { + /** + * Specifies the upgradePolicy property: Describes an upgrade policy - automatic, manual, or rolling.. + * + * @param upgradePolicy Describes an upgrade policy - automatic, manual, or rolling. + * @return the next definition stage. + */ + Update withUpgradePolicy(UpgradePolicy upgradePolicy); + } + /** * The stage of the Pool update allowing to specify resourceTags. */ diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/RollingUpgradePolicy.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/RollingUpgradePolicy.java new file mode 100644 index 0000000000000..67fb8e8650b3c --- /dev/null +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/RollingUpgradePolicy.java @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.batch.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The configuration parameters used while performing a rolling upgrade. + */ +@Fluent +public final class RollingUpgradePolicy { + /* + * Allow VMSS to ignore AZ boundaries when constructing upgrade batches. Take into consideration the Update Domain + * and maxBatchInstancePercent to determine the batch size. If this field is not set, Azure Azure Batch will not + * set its default value. The value of enableCrossZoneUpgrade on the created VirtualMachineScaleSet will be decided + * by the default configurations on VirtualMachineScaleSet. This field is able to be set to true or false only when + * using NodePlacementConfiguration as Zonal. + */ + @JsonProperty(value = "enableCrossZoneUpgrade") + private Boolean enableCrossZoneUpgrade; + + /* + * 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 value of this field should be + * between 5 and 100, inclusive. If both maxBatchInstancePercent and maxUnhealthyInstancePercent are assigned with + * value, the value of maxBatchInstancePercent should not be more than maxUnhealthyInstancePercent. + */ + @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 value of this field should be between 5 and 100, inclusive. If both maxBatchInstancePercent and + * maxUnhealthyInstancePercent are assigned with value, the value of maxBatchInstancePercent should not be more + * than maxUnhealthyInstancePercent. + */ + @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 value of this field should be between 0 and 100, inclusive. + */ + @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. + */ + @JsonProperty(value = "pauseTimeBetweenBatches") + private String pauseTimeBetweenBatches; + + /* + * Upgrade all unhealthy instances in a scale set before any healthy instances. + */ + @JsonProperty(value = "prioritizeUnhealthyInstances") + private Boolean prioritizeUnhealthyInstances; + + /* + * Rollback failed instances to previous model if the Rolling Upgrade policy is violated. + */ + @JsonProperty(value = "rollbackFailedInstancesOnPolicyBreach") + private Boolean rollbackFailedInstancesOnPolicyBreach; + + /** + * Creates an instance of RollingUpgradePolicy class. + */ + public RollingUpgradePolicy() { + } + + /** + * Get the enableCrossZoneUpgrade property: Allow VMSS to ignore AZ boundaries when constructing upgrade batches. + * Take into consideration the Update Domain and maxBatchInstancePercent to determine the batch size. If this field + * is not set, Azure Azure Batch will not set its default value. The value of enableCrossZoneUpgrade on the created + * VirtualMachineScaleSet will be decided by the default configurations on VirtualMachineScaleSet. This field is + * able to be set to true or false only when using NodePlacementConfiguration as Zonal. + * + * @return the enableCrossZoneUpgrade value. + */ + public Boolean enableCrossZoneUpgrade() { + return this.enableCrossZoneUpgrade; + } + + /** + * Set the enableCrossZoneUpgrade property: Allow VMSS to ignore AZ boundaries when constructing upgrade batches. + * Take into consideration the Update Domain and maxBatchInstancePercent to determine the batch size. If this field + * is not set, Azure Azure Batch will not set its default value. The value of enableCrossZoneUpgrade on the created + * VirtualMachineScaleSet will be decided by the default configurations on VirtualMachineScaleSet. This field is + * able to be set to true or false only when using NodePlacementConfiguration as Zonal. + * + * @param enableCrossZoneUpgrade the enableCrossZoneUpgrade value to set. + * @return the RollingUpgradePolicy object itself. + */ + public RollingUpgradePolicy withEnableCrossZoneUpgrade(Boolean enableCrossZoneUpgrade) { + this.enableCrossZoneUpgrade = enableCrossZoneUpgrade; + return this; + } + + /** + * 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 value of this field should be between 5 and 100, inclusive. If both maxBatchInstancePercent and + * maxUnhealthyInstancePercent are assigned with value, the value of maxBatchInstancePercent should not be more + * than maxUnhealthyInstancePercent. + * + * @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 value of this field should be between 5 and 100, inclusive. If both maxBatchInstancePercent and + * maxUnhealthyInstancePercent are assigned with value, the value of maxBatchInstancePercent should not be more + * than maxUnhealthyInstancePercent. + * + * @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 value of this field should be between 5 and 100, inclusive. If both + * maxBatchInstancePercent and maxUnhealthyInstancePercent are assigned with value, the value of + * maxBatchInstancePercent should not be more than maxUnhealthyInstancePercent. + * + * @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 value of this field should be between 5 and 100, inclusive. If both + * maxBatchInstancePercent and maxUnhealthyInstancePercent are assigned with value, the value of + * maxBatchInstancePercent should not be more than maxUnhealthyInstancePercent. + * + * @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 value of this field should be between 0 and + * 100, inclusive. + * + * @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 value of this field should be between 0 and + * 100, inclusive. + * + * @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. + * + * @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. + * + * @param pauseTimeBetweenBatches the pauseTimeBetweenBatches value to set. + * @return the RollingUpgradePolicy object itself. + */ + public RollingUpgradePolicy withPauseTimeBetweenBatches(String pauseTimeBetweenBatches) { + this.pauseTimeBetweenBatches = pauseTimeBetweenBatches; + return this; + } + + /** + * Get the prioritizeUnhealthyInstances property: Upgrade all unhealthy instances in a scale set before any healthy + * instances. + * + * @return the prioritizeUnhealthyInstances value. + */ + public Boolean prioritizeUnhealthyInstances() { + return this.prioritizeUnhealthyInstances; + } + + /** + * Set the prioritizeUnhealthyInstances property: Upgrade all unhealthy instances in a scale set before any healthy + * instances. + * + * @param prioritizeUnhealthyInstances the prioritizeUnhealthyInstances value to set. + * @return the RollingUpgradePolicy object itself. + */ + public RollingUpgradePolicy withPrioritizeUnhealthyInstances(Boolean prioritizeUnhealthyInstances) { + this.prioritizeUnhealthyInstances = prioritizeUnhealthyInstances; + return this; + } + + /** + * Get the rollbackFailedInstancesOnPolicyBreach property: Rollback failed instances to previous model if the + * Rolling Upgrade policy is violated. + * + * @return the rollbackFailedInstancesOnPolicyBreach value. + */ + public Boolean rollbackFailedInstancesOnPolicyBreach() { + return this.rollbackFailedInstancesOnPolicyBreach; + } + + /** + * Set the rollbackFailedInstancesOnPolicyBreach property: Rollback failed instances to previous model if the + * Rolling Upgrade policy is violated. + * + * @param rollbackFailedInstancesOnPolicyBreach the rollbackFailedInstancesOnPolicyBreach value to set. + * @return the RollingUpgradePolicy object itself. + */ + public RollingUpgradePolicy + withRollbackFailedInstancesOnPolicyBreach(Boolean rollbackFailedInstancesOnPolicyBreach) { + this.rollbackFailedInstancesOnPolicyBreach = rollbackFailedInstancesOnPolicyBreach; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/SupportedSku.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/SupportedSku.java index d314a153bce16..72afbfb41fde3 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/SupportedSku.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/SupportedSku.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.batch.models; import com.azure.resourcemanager.batch.fluent.models.SupportedSkuInner; +import java.time.OffsetDateTime; import java.util.List; /** @@ -32,6 +33,13 @@ public interface SupportedSku { */ List capabilities(); + /** + * Gets the batchSupportEndOfLife property: The time when Azure Batch service will retire this SKU. + * + * @return the batchSupportEndOfLife value. + */ + OffsetDateTime batchSupportEndOfLife(); + /** * Gets the inner com.azure.resourcemanager.batch.fluent.models.SupportedSkuInner object. * diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/UpgradeMode.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/UpgradeMode.java new file mode 100644 index 0000000000000..532e215d80418 --- /dev/null +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/UpgradeMode.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.batch.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * 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.<br /><br /> **Rolling** - Scale set performs + * updates in batches with an optional pause time in between. + */ +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) { + if (value == null) { + return null; + } + UpgradeMode[] items = UpgradeMode.values(); + for (UpgradeMode item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/UpgradePolicy.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/UpgradePolicy.java new file mode 100644 index 0000000000000..bd5bbf2ba9a0d --- /dev/null +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/com/azure/resourcemanager/batch/models/UpgradePolicy.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.batch.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes an upgrade policy - automatic, manual, or rolling. + */ +@Fluent +public final class UpgradePolicy { + /* + * 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.

**Rolling** - Scale set performs updates in batches with an + * optional pause time in between. + */ + @JsonProperty(value = "mode", required = true) + private UpgradeMode mode; + + /* + * The configuration parameters used for performing automatic OS upgrade. + */ + @JsonProperty(value = "automaticOSUpgradePolicy") + private AutomaticOSUpgradePolicy automaticOSUpgradePolicy; + + /* + * This property is only supported on Pools with the virtualMachineConfiguration property. + */ + @JsonProperty(value = "rollingUpgradePolicy") + private RollingUpgradePolicy rollingUpgradePolicy; + + /** + * Creates an instance of UpgradePolicy class. + */ + public UpgradePolicy() { + } + + /** + * 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.<br + * /><br /> **Rolling** - Scale set performs updates in batches with an optional pause time in between. + * + * @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.<br + * /><br /> **Rolling** - Scale set performs updates in batches with an optional pause time in between. + * + * @param mode the mode value to set. + * @return the UpgradePolicy object itself. + */ + public UpgradePolicy withMode(UpgradeMode mode) { + this.mode = mode; + return this; + } + + /** + * Get the automaticOSUpgradePolicy property: The configuration parameters used for performing automatic OS + * upgrade. + * + * @return the automaticOSUpgradePolicy value. + */ + public AutomaticOSUpgradePolicy automaticOSUpgradePolicy() { + return this.automaticOSUpgradePolicy; + } + + /** + * Set the automaticOSUpgradePolicy property: The 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; + } + + /** + * Get the rollingUpgradePolicy property: This property is only supported on Pools with the + * virtualMachineConfiguration property. + * + * @return the rollingUpgradePolicy value. + */ + public RollingUpgradePolicy rollingUpgradePolicy() { + return this.rollingUpgradePolicy; + } + + /** + * Set the rollingUpgradePolicy property: This property is only supported on Pools with the + * virtualMachineConfiguration property. + * + * @param rollingUpgradePolicy the rollingUpgradePolicy value to set. + * @return the UpgradePolicy object itself. + */ + public UpgradePolicy withRollingUpgradePolicy(RollingUpgradePolicy rollingUpgradePolicy) { + this.rollingUpgradePolicy = rollingUpgradePolicy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (mode() == null) { + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property mode in model UpgradePolicy")); + } + if (automaticOSUpgradePolicy() != null) { + automaticOSUpgradePolicy().validate(); + } + if (rollingUpgradePolicy() != null) { + rollingUpgradePolicy().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(UpgradePolicy.class); +} diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/java/module-info.java b/sdk/batch/azure-resourcemanager-batch/src/main/java/module-info.java index 57ef56c592101..a9a05594156ef 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/java/module-info.java +++ b/sdk/batch/azure-resourcemanager-batch/src/main/java/module-info.java @@ -4,12 +4,10 @@ module com.azure.resourcemanager.batch { requires transitive com.azure.core.management; - exports com.azure.resourcemanager.batch; exports com.azure.resourcemanager.batch.fluent; exports com.azure.resourcemanager.batch.fluent.models; exports com.azure.resourcemanager.batch.models; - opens com.azure.resourcemanager.batch.fluent.models to com.azure.core, com.fasterxml.jackson.databind; opens com.azure.resourcemanager.batch.models to com.azure.core, com.fasterxml.jackson.databind; } diff --git a/sdk/batch/azure-resourcemanager-batch/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-batch/reflect-config.json b/sdk/batch/azure-resourcemanager-batch/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-batch/reflect-config.json index 89db28166538e..04f6c9d0b5cb2 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-batch/reflect-config.json +++ b/sdk/batch/azure-resourcemanager-batch/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-batch/reflect-config.json @@ -523,6 +523,21 @@ "allDeclaredConstructors" : true, "allDeclaredFields" : true, "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.batch.models.UpgradePolicy", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.batch.models.AutomaticOSUpgradePolicy", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.batch.models.RollingUpgradePolicy", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true }, { "name" : "com.azure.resourcemanager.batch.models.BatchPoolIdentity", "allDeclaredConstructors" : true, @@ -773,6 +788,11 @@ "allDeclaredConstructors" : true, "allDeclaredFields" : true, "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.batch.models.UpgradeMode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true }, { "name" : "com.azure.resourcemanager.batch.models.PoolIdentityType", "allDeclaredConstructors" : true, diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationCreateSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationCreateSamples.java index 32d4cb553d544..664c1eab17a2e 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationCreateSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationCreateSamples.java @@ -10,7 +10,7 @@ public final class ApplicationCreateSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationCreate.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationCreate.json */ /** * Sample code: ApplicationCreate. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationDeleteSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationDeleteSamples.java index 4e40b0984e073..29ccc1bfadc93 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationDeleteSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationDeleteSamples.java @@ -10,7 +10,7 @@ public final class ApplicationDeleteSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationDelete.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationDelete.json */ /** * Sample code: ApplicationDelete. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationGetSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationGetSamples.java index 037cd91b495dc..6374eea493e08 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationGetSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationGetSamples.java @@ -10,7 +10,7 @@ public final class ApplicationGetSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationGet.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationGet.json */ /** * Sample code: ApplicationGet. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationListSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationListSamples.java index 02826c696b5b1..2d2bbecb46d08 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationListSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationListSamples.java @@ -10,7 +10,7 @@ public final class ApplicationListSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationList.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationList.json */ /** * Sample code: ApplicationList. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageActivateSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageActivateSamples.java index db320c277477b..66b0b6809384d 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageActivateSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageActivateSamples.java @@ -12,7 +12,7 @@ public final class ApplicationPackageActivateSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationPackageActivate.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationPackageActivate.json */ /** * Sample code: ApplicationPackageActivate. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageCreateSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageCreateSamples.java index 65b51fb9d8823..70f76a679edfb 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageCreateSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageCreateSamples.java @@ -10,7 +10,7 @@ public final class ApplicationPackageCreateSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationPackageCreate.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationPackageCreate.json */ /** * Sample code: ApplicationPackageCreate. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageDeleteSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageDeleteSamples.java index a0cf15f093482..c3e355906d9a3 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageDeleteSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageDeleteSamples.java @@ -10,7 +10,7 @@ public final class ApplicationPackageDeleteSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationPackageDelete.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationPackageDelete.json */ /** * Sample code: ApplicationPackageDelete. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageGetSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageGetSamples.java index 759f90fe9950c..95f765f3860f2 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageGetSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageGetSamples.java @@ -10,7 +10,7 @@ public final class ApplicationPackageGetSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationPackageGet.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationPackageGet.json */ /** * Sample code: ApplicationPackageGet. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageListSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageListSamples.java index 4d308b4a4618c..65a01341b69b0 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageListSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationPackageListSamples.java @@ -10,7 +10,7 @@ public final class ApplicationPackageListSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationPackageList.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationPackageList.json */ /** * Sample code: ApplicationPackageList. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationUpdateSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationUpdateSamples.java index 7154dca608cbb..8d6385166d4c2 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationUpdateSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/ApplicationUpdateSamples.java @@ -12,7 +12,7 @@ public final class ApplicationUpdateSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ApplicationUpdate.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ApplicationUpdate.json */ /** * Sample code: ApplicationUpdate. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountCreateSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountCreateSamples.java index 4edc77637ae83..d11dcfd21f8d9 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountCreateSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountCreateSamples.java @@ -20,7 +20,7 @@ public final class BatchAccountCreateSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountCreate_BYOS.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_BYOS.json */ /** * Sample code: BatchAccountCreate_BYOS. @@ -40,7 +40,7 @@ public static void batchAccountCreateBYOS(com.azure.resourcemanager.batch.BatchM } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ * BatchAccountCreate_UserAssignedIdentity.json */ /** @@ -62,7 +62,7 @@ public static void batchAccountCreateUserAssignedIdentity(com.azure.resourcemana /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PrivateBatchAccountCreate.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateBatchAccountCreate.json */ /** * Sample code: PrivateBatchAccountCreate. @@ -81,7 +81,7 @@ public static void privateBatchAccountCreate(com.azure.resourcemanager.batch.Bat } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ * BatchAccountCreate_SystemAssignedIdentity.json */ /** @@ -100,7 +100,7 @@ public static void batchAccountCreateSystemAssignedIdentity(com.azure.resourcema /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountCreate_Default.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountCreate_Default.json */ /** * Sample code: BatchAccountCreate_Default. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountDeleteSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountDeleteSamples.java index c03337039a0b1..efe94f257451c 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountDeleteSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountDeleteSamples.java @@ -10,7 +10,7 @@ public final class BatchAccountDeleteSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountDelete.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountDelete.json */ /** * Sample code: BatchAccountDelete. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountGetByResourceGroupSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountGetByResourceGroupSamples.java index c4e4d49380a1e..92b1d3620a4b9 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountGetByResourceGroupSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountGetByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class BatchAccountGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PrivateBatchAccountGet.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateBatchAccountGet.json */ /** * Sample code: PrivateBatchAccountGet. @@ -24,7 +24,7 @@ public static void privateBatchAccountGet(com.azure.resourcemanager.batch.BatchM /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountGet.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountGet.json */ /** * Sample code: BatchAccountGet. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountGetDetectorSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountGetDetectorSamples.java index 4bd561ccac764..c8b6f13e7001e 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountGetDetectorSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountGetDetectorSamples.java @@ -10,7 +10,7 @@ public final class BatchAccountGetDetectorSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/DetectorGet.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/DetectorGet.json */ /** * Sample code: GetDetector. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountGetKeysSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountGetKeysSamples.java index 58e949c158395..6d68196dfec71 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountGetKeysSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountGetKeysSamples.java @@ -10,7 +10,7 @@ public final class BatchAccountGetKeysSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountGetKeys.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountGetKeys.json */ /** * Sample code: BatchAccountGetKeys. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountListByResourceGroupSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountListByResourceGroupSamples.java index 2347a71c21010..1a537cdecb7dc 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountListByResourceGroupSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountListByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class BatchAccountListByResourceGroupSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountListByResourceGroup. + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountListByResourceGroup. * json */ /** diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountListDetectorsSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountListDetectorsSamples.java index 157dda2a3834f..1489167ee81ff 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountListDetectorsSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountListDetectorsSamples.java @@ -10,7 +10,7 @@ public final class BatchAccountListDetectorsSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/DetectorList.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/DetectorList.json */ /** * Sample code: ListDetectors. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountListOutboundNetworkDependenciesEndpointsSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountListOutboundNetworkDependenciesEndpointsSamples.java index 184d6d76ef5b6..2402bed749ef9 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountListOutboundNetworkDependenciesEndpointsSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountListOutboundNetworkDependenciesEndpointsSamples.java @@ -9,7 +9,7 @@ */ public final class BatchAccountListOutboundNetworkDependenciesEndpointsSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ * BatchAccountListOutboundNetworkDependenciesEndpoints.json */ /** diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountListSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountListSamples.java index 7ac48545b3bc7..ff1e81fdb79e6 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountListSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountListSamples.java @@ -10,7 +10,7 @@ public final class BatchAccountListSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountList.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountList.json */ /** * Sample code: BatchAccountList. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountRegenerateKeySamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountRegenerateKeySamples.java index 38c7472ce3e0d..f80e9ba98f752 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountRegenerateKeySamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountRegenerateKeySamples.java @@ -13,7 +13,7 @@ public final class BatchAccountRegenerateKeySamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountRegenerateKey.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountRegenerateKey.json */ /** * Sample code: BatchAccountRegenerateKey. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountSynchronizeAutoStorageKeysSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountSynchronizeAutoStorageKeysSamples.java index a6b07fb5e752b..94ab3d4872047 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountSynchronizeAutoStorageKeysSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountSynchronizeAutoStorageKeysSamples.java @@ -9,7 +9,7 @@ */ public final class BatchAccountSynchronizeAutoStorageKeysSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ * BatchAccountSynchronizeAutoStorageKeys.json */ /** diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountUpdateSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountUpdateSamples.java index ee82432785c2a..05091a9dd807e 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountUpdateSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/BatchAccountUpdateSamples.java @@ -13,7 +13,7 @@ public final class BatchAccountUpdateSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/BatchAccountUpdate.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/BatchAccountUpdate.json */ /** * Sample code: BatchAccountUpdate. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateCancelDeletionSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateCancelDeletionSamples.java index bff20c21ce095..c39302a13b174 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateCancelDeletionSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateCancelDeletionSamples.java @@ -10,7 +10,7 @@ public final class CertificateCancelDeletionSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateCancelDeletion.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateCancelDeletion.json */ /** * Sample code: CertificateCancelDeletion. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateCreateSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateCreateSamples.java index edcddf4cde1eb..04096518233d4 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateCreateSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateCreateSamples.java @@ -12,7 +12,7 @@ public final class CertificateCreateSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateCreate_Full.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateCreate_Full.json */ /** * Sample code: CreateCertificate - Full. @@ -28,7 +28,7 @@ public static void createCertificateFull(com.azure.resourcemanager.batch.BatchMa /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateCreate_Minimal.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateCreate_Minimal.json */ /** * Sample code: CreateCertificate - Minimal Pfx. @@ -43,7 +43,7 @@ public static void createCertificateMinimalPfx(com.azure.resourcemanager.batch.B /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateCreate_MinimalCer.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateCreate_MinimalCer.json */ /** * Sample code: CreateCertificate - Minimal Cer. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateDeleteSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateDeleteSamples.java index d95f3e81dc7c3..3006d3455f205 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateDeleteSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateDeleteSamples.java @@ -10,7 +10,7 @@ public final class CertificateDeleteSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateDelete.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateDelete.json */ /** * Sample code: CertificateDelete. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateGetSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateGetSamples.java index c24c4986028dd..12348be264276 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateGetSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateGetSamples.java @@ -10,7 +10,7 @@ public final class CertificateGetSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateGetWithDeletionError. + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateGetWithDeletionError. * json */ /** @@ -25,7 +25,7 @@ public static void getCertificateWithDeletionError(com.azure.resourcemanager.bat /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateGet.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateGet.json */ /** * Sample code: Get Certificate. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateListByBatchAccountSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateListByBatchAccountSamples.java index 2a52015070fbc..21d607d80986b 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateListByBatchAccountSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateListByBatchAccountSamples.java @@ -10,7 +10,7 @@ public final class CertificateListByBatchAccountSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateListWithFilter.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateListWithFilter.json */ /** * Sample code: ListCertificates - Filter and Select. @@ -26,7 +26,7 @@ public static void listCertificatesFilterAndSelect(com.azure.resourcemanager.bat /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateList.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateList.json */ /** * Sample code: ListCertificates. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateUpdateSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateUpdateSamples.java index ca46276aebcb7..0420c88a51094 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateUpdateSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/CertificateUpdateSamples.java @@ -12,7 +12,7 @@ public final class CertificateUpdateSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/CertificateUpdate.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/CertificateUpdate.json */ /** * Sample code: UpdateCertificate. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/LocationCheckNameAvailabilitySamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/LocationCheckNameAvailabilitySamples.java index f3d6c868b58d1..2bac07af7685e 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/LocationCheckNameAvailabilitySamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/LocationCheckNameAvailabilitySamples.java @@ -11,7 +11,7 @@ */ public final class LocationCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ * LocationCheckNameAvailability_AlreadyExists.json */ /** @@ -26,7 +26,7 @@ public final class LocationCheckNameAvailabilitySamples { } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ * LocationCheckNameAvailability_Available.json */ /** diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/LocationGetQuotasSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/LocationGetQuotasSamples.java index 56d6747383a4a..36b3063c9a6b9 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/LocationGetQuotasSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/LocationGetQuotasSamples.java @@ -10,7 +10,7 @@ public final class LocationGetQuotasSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/LocationGetQuotas.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/LocationGetQuotas.json */ /** * Sample code: LocationGetQuotas. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/LocationListSupportedCloudServiceSkusSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/LocationListSupportedCloudServiceSkusSamples.java index b75573c0f922a..751196c6a4245 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/LocationListSupportedCloudServiceSkusSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/LocationListSupportedCloudServiceSkusSamples.java @@ -10,7 +10,7 @@ public final class LocationListSupportedCloudServiceSkusSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/LocationListCloudServiceSkus.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/LocationListCloudServiceSkus.json */ /** * Sample code: LocationListCloudServiceSkus. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/LocationListSupportedVirtualMachineSkusSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/LocationListSupportedVirtualMachineSkusSamples.java index f3d0ad557beb6..a55532fabc945 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/LocationListSupportedVirtualMachineSkusSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/LocationListSupportedVirtualMachineSkusSamples.java @@ -10,7 +10,7 @@ public final class LocationListSupportedVirtualMachineSkusSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/LocationListVirtualMachineSkus. + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/LocationListVirtualMachineSkus. * json */ /** diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/OperationsListSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/OperationsListSamples.java index 55a9e3a500207..586078bf2c6e9 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/OperationsListSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/OperationsListSamples.java @@ -10,7 +10,7 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/OperationsList.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/OperationsList.json */ /** * Sample code: OperationsList. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolCreateSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolCreateSamples.java index da759c8f33767..678978951dd1a 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolCreateSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolCreateSamples.java @@ -10,6 +10,7 @@ import com.azure.resourcemanager.batch.models.AutoScaleSettings; import com.azure.resourcemanager.batch.models.AutoUserScope; import com.azure.resourcemanager.batch.models.AutoUserSpecification; +import com.azure.resourcemanager.batch.models.AutomaticOSUpgradePolicy; import com.azure.resourcemanager.batch.models.BatchPoolIdentity; import com.azure.resourcemanager.batch.models.CachingType; import com.azure.resourcemanager.batch.models.CertificateReference; @@ -46,6 +47,7 @@ import com.azure.resourcemanager.batch.models.PoolIdentityType; import com.azure.resourcemanager.batch.models.PublicIpAddressConfiguration; import com.azure.resourcemanager.batch.models.ResourceFile; +import com.azure.resourcemanager.batch.models.RollingUpgradePolicy; import com.azure.resourcemanager.batch.models.ScaleSettings; import com.azure.resourcemanager.batch.models.SecurityProfile; import com.azure.resourcemanager.batch.models.SecurityTypes; @@ -54,6 +56,8 @@ import com.azure.resourcemanager.batch.models.StorageAccountType; import com.azure.resourcemanager.batch.models.TaskSchedulingPolicy; import com.azure.resourcemanager.batch.models.UefiSettings; +import com.azure.resourcemanager.batch.models.UpgradeMode; +import com.azure.resourcemanager.batch.models.UpgradePolicy; import com.azure.resourcemanager.batch.models.UserAccount; import com.azure.resourcemanager.batch.models.UserAssignedIdentities; import com.azure.resourcemanager.batch.models.UserIdentity; @@ -71,7 +75,7 @@ */ public final class PoolCreateSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ * PoolCreate_VirtualMachineConfiguration_ServiceArtifactReference.json */ /** @@ -93,12 +97,14 @@ public static void createPoolVirtualMachineConfigurationServiceArtifactReference "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile")))) .withScaleSettings(new ScaleSettings() .withFixedScale(new FixedScaleSettings().withTargetDedicatedNodes(2).withTargetLowPriorityNodes(0))) + .withUpgradePolicy(new UpgradePolicy().withMode(UpgradeMode.AUTOMATIC) + .withAutomaticOSUpgradePolicy(new AutomaticOSUpgradePolicy().withEnableAutomaticOSUpgrade(true))) .create(); } /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_SecurityProfile.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolCreate_SecurityProfile.json */ /** * Sample code: CreatePool - SecurityProfile. @@ -122,7 +128,7 @@ public static void createPoolSecurityProfile(com.azure.resourcemanager.batch.Bat } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ * PoolCreate_VirtualMachineConfiguration_ManagedOSDisk.json */ /** @@ -148,7 +154,7 @@ public static void createPoolSecurityProfile(com.azure.resourcemanager.batch.Bat } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ * PoolCreate_MinimalCloudServiceConfiguration.json */ /** @@ -167,7 +173,7 @@ public static void createPoolSecurityProfile(com.azure.resourcemanager.batch.Bat } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ * PoolCreate_MinimalVirtualMachineConfiguration.json */ /** @@ -192,7 +198,7 @@ public static void createPoolSecurityProfile(com.azure.resourcemanager.batch.Bat } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ * PoolCreate_VirtualMachineConfiguration_Extensions.json */ /** @@ -223,7 +229,7 @@ public static void createPoolVirtualMachineConfigurationExtensions( /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_UserAssignedIdentities + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolCreate_UserAssignedIdentities * .json */ /** @@ -254,7 +260,41 @@ public static void createPoolUserAssignedIdentities(com.azure.resourcemanager.ba /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_AcceleratedNetworking. + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolCreate_UpgradePolicy.json + */ + /** + * Sample code: CreatePool - UpgradePolicy. + * + * @param manager Entry point to BatchManager. + */ + public static void createPoolUpgradePolicy(com.azure.resourcemanager.batch.BatchManager manager) { + manager.pools().define("testpool").withExistingBatchAccount("default-azurebatch-japaneast", "sampleacct") + .withVmSize("Standard_d4s_v3") + .withDeploymentConfiguration( + new DeploymentConfiguration().withVirtualMachineConfiguration(new VirtualMachineConfiguration() + .withImageReference(new ImageReference().withPublisher("MicrosoftWindowsServer") + .withOffer("WindowsServer").withSku("2019-datacenter-smalldisk").withVersion("latest")) + .withNodeAgentSkuId("batch.node.windows amd64") + .withWindowsConfiguration(new WindowsConfiguration().withEnableAutomaticUpdates(false)) + .withNodePlacementConfiguration( + new NodePlacementConfiguration().withPolicy(NodePlacementPolicyType.ZONAL)))) + .withScaleSettings(new ScaleSettings() + .withFixedScale(new FixedScaleSettings().withTargetDedicatedNodes(2).withTargetLowPriorityNodes(0))) + .withUpgradePolicy( + new UpgradePolicy().withMode(UpgradeMode.AUTOMATIC) + .withAutomaticOSUpgradePolicy(new AutomaticOSUpgradePolicy().withDisableAutomaticRollback(true) + .withEnableAutomaticOSUpgrade(true).withUseRollingUpgradePolicy(true) + .withOsRollingUpgradeDeferral(true)) + .withRollingUpgradePolicy(new RollingUpgradePolicy().withEnableCrossZoneUpgrade(true) + .withMaxBatchInstancePercent(20).withMaxUnhealthyInstancePercent(20) + .withMaxUnhealthyUpgradedInstancePercent(20).withPauseTimeBetweenBatches("PT0S") + .withPrioritizeUnhealthyInstances(false).withRollbackFailedInstancesOnPolicyBreach(false))) + .create(); + } + + /* + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolCreate_AcceleratedNetworking. * json */ /** @@ -279,7 +319,7 @@ public static void createPoolAcceleratedNetworking(com.azure.resourcemanager.bat } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ * PoolCreate_VirtualMachineConfiguration.json */ /** @@ -331,7 +371,7 @@ public static void createPoolFullVirtualMachineConfiguration(com.azure.resourcem /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_SharedImageGallery. + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolCreate_SharedImageGallery. * json */ /** @@ -350,7 +390,7 @@ public static void createPoolCustomImage(com.azure.resourcemanager.batch.BatchMa } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ * PoolCreate_CloudServiceConfiguration.json */ /** @@ -402,7 +442,7 @@ public static void createPoolFullCloudServiceConfiguration(com.azure.resourceman /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_NoPublicIPAddresses. + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolCreate_NoPublicIPAddresses. * json */ /** @@ -426,7 +466,7 @@ public static void createPoolNoPublicIP(com.azure.resourcemanager.batch.BatchMan /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_ResourceTags.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolCreate_ResourceTags.json */ /** * Sample code: CreatePool - ResourceTags. @@ -448,7 +488,7 @@ public static void createPoolResourceTags(com.azure.resourcemanager.batch.BatchM /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolCreate_PublicIPs.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolCreate_PublicIPs.json */ /** * Sample code: CreatePool - Public IPs. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolDeleteSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolDeleteSamples.java index 5fbcf895a5074..bf5021ddfced0 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolDeleteSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolDeleteSamples.java @@ -10,7 +10,7 @@ public final class PoolDeleteSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolDelete.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolDelete.json */ /** * Sample code: DeletePool. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolDisableAutoScaleSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolDisableAutoScaleSamples.java index 3b70b3c5ae625..943106d6b503a 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolDisableAutoScaleSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolDisableAutoScaleSamples.java @@ -10,7 +10,7 @@ public final class PoolDisableAutoScaleSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolDisableAutoScale.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolDisableAutoScale.json */ /** * Sample code: Disable AutoScale. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolGetSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolGetSamples.java index 0b72d8b4a63b5..fdc301d2c3ac2 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolGetSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolGetSamples.java @@ -10,7 +10,7 @@ public final class PoolGetSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolGet_SecurityProfile.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolGet_SecurityProfile.json */ /** * Sample code: GetPool - SecurityProfile. @@ -23,7 +23,7 @@ public static void getPoolSecurityProfile(com.azure.resourcemanager.batch.BatchM } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ * PoolGet_VirtualMachineConfiguration_Extensions.json */ /** @@ -38,7 +38,7 @@ public static void getPoolSecurityProfile(com.azure.resourcemanager.batch.BatchM } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ * PoolGet_VirtualMachineConfiguration_MangedOSDisk.json */ /** @@ -52,7 +52,21 @@ public static void getPoolVirtualMachineConfigurationOSDisk(com.azure.resourcema } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/ + * x-ms-original-file: + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolGet_UpgradePolicy.json + */ + /** + * Sample code: GetPool - UpgradePolicy. + * + * @param manager Entry point to BatchManager. + */ + public static void getPoolUpgradePolicy(com.azure.resourcemanager.batch.BatchManager manager) { + manager.pools().getWithResponse("default-azurebatch-japaneast", "sampleacct", "testpool", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/ * PoolGet_VirtualMachineConfiguration_ServiceArtifactReference.json */ /** @@ -68,7 +82,7 @@ public static void getPoolVirtualMachineConfigurationServiceArtifactReference( /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolGet_AcceleratedNetworking. + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolGet_AcceleratedNetworking. * json */ /** @@ -82,7 +96,7 @@ public static void getPoolAcceleratedNetworking(com.azure.resourcemanager.batch. } /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolGet.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolGet.json */ /** * Sample code: GetPool. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolListByBatchAccountSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolListByBatchAccountSamples.java index d71a1c506acce..32ca7c7372c9e 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolListByBatchAccountSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolListByBatchAccountSamples.java @@ -9,7 +9,7 @@ */ public final class PoolListByBatchAccountSamples { /* - * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolList.json + * x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolList.json */ /** * Sample code: ListPool. @@ -23,7 +23,7 @@ public static void listPool(com.azure.resourcemanager.batch.BatchManager manager /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolListWithFilter.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolListWithFilter.json */ /** * Sample code: ListPoolWithFilter. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolStopResizeSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolStopResizeSamples.java index 02f0e01ac2a7f..85d6ada39ed08 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolStopResizeSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolStopResizeSamples.java @@ -10,7 +10,7 @@ public final class PoolStopResizeSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolStopResize.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolStopResize.json */ /** * Sample code: StopPoolResize. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolUpdateSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolUpdateSamples.java index 81ae0776c3e61..781011f9a6a5d 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolUpdateSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PoolUpdateSamples.java @@ -24,7 +24,7 @@ public final class PoolUpdateSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolUpdate_EnableAutoScale.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolUpdate_EnableAutoScale.json */ /** * Sample code: UpdatePool - Enable Autoscale. @@ -43,7 +43,7 @@ public static void updatePoolEnableAutoscale(com.azure.resourcemanager.batch.Bat /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolUpdate_RemoveStartTask.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolUpdate_RemoveStartTask.json */ /** * Sample code: UpdatePool - Remove Start Task. @@ -59,7 +59,7 @@ public static void updatePoolRemoveStartTask(com.azure.resourcemanager.batch.Bat /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolUpdate_ResizePool.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolUpdate_ResizePool.json */ /** * Sample code: UpdatePool - Resize Pool. @@ -79,7 +79,7 @@ public static void updatePoolResizePool(com.azure.resourcemanager.batch.BatchMan /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PoolUpdate_OtherProperties.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PoolUpdate_OtherProperties.json */ /** * Sample code: UpdatePool - Other Properties. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionDeleteSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionDeleteSamples.java index cf8ce2f125075..4d3464b08e828 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionDeleteSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionDeleteSamples.java @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionDeleteSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PrivateEndpointConnectionDelete. + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateEndpointConnectionDelete. * json */ /** diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionGetSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionGetSamples.java index c1b9c2b8bae08..98c7ebf4bf58a 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionGetSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionGetSamples.java @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionGetSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PrivateEndpointConnectionGet.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateEndpointConnectionGet.json */ /** * Sample code: GetPrivateEndpointConnection. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionListByBatchAccountSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionListByBatchAccountSamples.java index 596bca57c53ce..f9130e75850db 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionListByBatchAccountSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionListByBatchAccountSamples.java @@ -10,7 +10,7 @@ public final class PrivateEndpointConnectionListByBatchAccountSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PrivateEndpointConnectionsList. + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateEndpointConnectionsList. * json */ /** diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionUpdateSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionUpdateSamples.java index 7f16886536b41..b66100f9a731f 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionUpdateSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionUpdateSamples.java @@ -14,7 +14,7 @@ public final class PrivateEndpointConnectionUpdateSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PrivateEndpointConnectionUpdate. + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateEndpointConnectionUpdate. * json */ /** diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateLinkResourceGetSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateLinkResourceGetSamples.java index 2bf527a562b02..e6085cc9840e5 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateLinkResourceGetSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateLinkResourceGetSamples.java @@ -10,7 +10,7 @@ public final class PrivateLinkResourceGetSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PrivateLinkResourceGet.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateLinkResourceGet.json */ /** * Sample code: GetPrivateLinkResource. diff --git a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateLinkResourceListByBatchAccountSamples.java b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateLinkResourceListByBatchAccountSamples.java index 0c56af29b60ba..882ef621d597f 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateLinkResourceListByBatchAccountSamples.java +++ b/sdk/batch/azure-resourcemanager-batch/src/samples/java/com/azure/resourcemanager/batch/generated/PrivateLinkResourceListByBatchAccountSamples.java @@ -10,7 +10,7 @@ public final class PrivateLinkResourceListByBatchAccountSamples { /* * x-ms-original-file: - * specification/batch/resource-manager/Microsoft.Batch/stable/2023-11-01/examples/PrivateLinkResourcesList.json + * specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/PrivateLinkResourcesList.json */ /** * Sample code: ListPrivateLinkResource. diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/BatchTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/BatchTests.java index f477ccdb10868..4ca96c955d849 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/BatchTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/BatchTests.java @@ -20,12 +20,13 @@ import com.azure.resourcemanager.batch.models.BatchAccount; import com.azure.resourcemanager.batch.models.BatchAccountKeys; import com.azure.resourcemanager.batch.models.BatchAccountRegenerateKeyParameters; -import com.azure.resourcemanager.batch.models.CloudServiceConfiguration; import com.azure.resourcemanager.batch.models.ComputeNodeDeallocationOption; import com.azure.resourcemanager.batch.models.DeploymentConfiguration; import com.azure.resourcemanager.batch.models.FixedScaleSettings; +import com.azure.resourcemanager.batch.models.ImageReference; import com.azure.resourcemanager.batch.models.Pool; import com.azure.resourcemanager.batch.models.ScaleSettings; +import com.azure.resourcemanager.batch.models.VirtualMachineConfiguration; import com.azure.resourcemanager.storage.StorageManager; import com.azure.resourcemanager.storage.models.StorageAccount; import org.junit.jupiter.api.Assertions; @@ -276,8 +277,11 @@ public void testCRUDBatchPool() { .withDisplayName(poolDisplayName) .withDeploymentConfiguration( new DeploymentConfiguration() - .withCloudServiceConfiguration( - new CloudServiceConfiguration().withOsFamily("4"))) + .withVirtualMachineConfiguration( + new VirtualMachineConfiguration() + .withImageReference(new ImageReference().withPublisher("Canonical") + .withOffer("UbuntuServer").withSku("18.04-LTS").withVersion("latest")) + .withNodeAgentSkuId("batch.node.ubuntu 18.04"))) .withScaleSettings( new ScaleSettings() .withFixedScale( diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesActivateWithResponseMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesActivateWithResponseMockTests.java index f063dc9288122..da571bc8ad172 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesActivateWithResponseMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesActivateWithResponseMockTests.java @@ -31,7 +31,7 @@ public void testActivateWithResponse() throws Exception { ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); String responseStr - = "{\"properties\":{\"state\":\"Active\",\"format\":\"mtdh\",\"storageUrl\":\"dvypgikdgsz\",\"storageUrlExpiry\":\"2021-09-09T14:02:20Z\",\"lastActivationTime\":\"2021-01-23T14:08:39Z\"},\"etag\":\"ryuzh\",\"id\":\"hkjoqr\",\"name\":\"qqaatjinrvgou\",\"type\":\"mfiibfggj\"}"; + = "{\"properties\":{\"state\":\"Pending\",\"format\":\"lazszrn\",\"storageUrl\":\"iin\",\"storageUrlExpiry\":\"2021-01-06T22:30:17Z\",\"lastActivationTime\":\"2021-03-15T09:11:44Z\"},\"etag\":\"ylwbtlhflsjcdhsz\",\"id\":\"jvfbgofelja\",\"name\":\"rqmq\",\"type\":\"ldvriiiojnalghfk\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -49,8 +49,8 @@ public void testActivateWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); ApplicationPackage response = manager.applicationPackages() - .activateWithResponse("erqwkyhkobopg", "edkowepbqpcrfk", "wccsnjvcdwxlpqek", "tn", - new ActivateApplicationPackageParameters().withFormat("htjsying"), com.azure.core.util.Context.NONE) + .activateWithResponse("owqkdwytisi", "ircgpikpz", "mejzanlfzxia", "rmbzo", + new ActivateApplicationPackageParameters().withFormat("okixrjqcir"), com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesCreateWithResponseMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesCreateWithResponseMockTests.java index 8d11d244fd3e9..23f3e3df80f51 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesCreateWithResponseMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesCreateWithResponseMockTests.java @@ -30,7 +30,7 @@ public void testCreateWithResponse() throws Exception { ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); String responseStr - = "{\"properties\":{\"state\":\"Pending\",\"format\":\"kpj\",\"storageUrl\":\"qmt\",\"storageUrlExpiry\":\"2021-03-16T18:33:01Z\",\"lastActivationTime\":\"2021-09-01T21:15:43Z\"},\"etag\":\"jihy\",\"id\":\"ozphvwauyqncygu\",\"name\":\"kvi\",\"type\":\"mdscwxqupev\"}"; + = "{\"properties\":{\"state\":\"Active\",\"format\":\"gvjayvblmh\",\"storageUrl\":\"zuhbxvvyhgsopb\",\"storageUrlExpiry\":\"2021-10-16T16:37:11Z\",\"lastActivationTime\":\"2021-05-14T00:06:10Z\"},\"etag\":\"g\",\"id\":\"uvwzfbnh\",\"name\":\"mctlpdngitv\",\"type\":\"bmhrixkwmyijejv\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -47,8 +47,8 @@ public void testCreateWithResponse() throws Exception { tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - ApplicationPackage response - = manager.applicationPackages().define("jjoqkagf").withExistingApplication("brnjwmw", "pn", "saz").create(); + ApplicationPackage response = manager.applicationPackages().define("tmtdhtmdvypgik") + .withExistingApplication("tn", "htjsying", "fq").create(); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesDeleteWithResponseMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesDeleteWithResponseMockTests.java index 647c7cc7b3467..162f62cfb3b69 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesDeleteWithResponseMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesDeleteWithResponseMockTests.java @@ -45,7 +45,7 @@ public void testDeleteWithResponse() throws Exception { tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.applicationPackages().deleteWithResponse("ool", "rwxkvtkkgl", "qwjygvja", "vblm", + manager.applicationPackages().deleteWithResponse("tvsexsowuel", "qhhahhxvrhmzkwpj", "wws", "ughftqsx", com.azure.core.util.Context.NONE); } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesGetWithResponseMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesGetWithResponseMockTests.java index c50fd477fb99e..3543fa5e16903 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesGetWithResponseMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesGetWithResponseMockTests.java @@ -30,7 +30,7 @@ public void testGetWithResponse() throws Exception { ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); String responseStr - = "{\"properties\":{\"state\":\"Pending\",\"format\":\"ixkwmyijejveg\",\"storageUrl\":\"bpnaixexccbdre\",\"storageUrlExpiry\":\"2021-04-07T14:01:01Z\",\"lastActivationTime\":\"2021-09-06T10:46:02Z\"},\"etag\":\"drrvqahqkght\",\"id\":\"wijnh\",\"name\":\"jsvfycxzbfvoowv\",\"type\":\"vmtgjqppy\"}"; + = "{\"properties\":{\"state\":\"Pending\",\"format\":\"zqzudph\",\"storageUrl\":\"mvdk\",\"storageUrlExpiry\":\"2021-09-19T23:00:24Z\",\"lastActivationTime\":\"2021-08-12T04:12:29Z\"},\"etag\":\"vtbvkayh\",\"id\":\"tnvyqiatkzwp\",\"name\":\"npwzcjaes\",\"type\":\"vvsccyajguq\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -48,7 +48,7 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); ApplicationPackage response = manager.applicationPackages() - .getWithResponse("vkzuhbxvvyhgso", "byrqufeg", "uvwzfbnh", "mctlpdngitv", com.azure.core.util.Context.NONE) + .getWithResponse("qxujxukndxd", "grjguufzd", "syqtfi", "whbotzingamv", com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesListMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesListMockTests.java index 2f2a271484561..42e0956db9d08 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesListMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationPackagesListMockTests.java @@ -31,7 +31,7 @@ public void testList() throws Exception { ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); String responseStr - = "{\"value\":[{\"properties\":{\"state\":\"Pending\",\"format\":\"rjreafxts\",\"storageUrl\":\"mhjglikkxwslolb\",\"storageUrlExpiry\":\"2021-11-05T04:06:51Z\",\"lastActivationTime\":\"2021-08-07T04:15:04Z\"},\"etag\":\"m\",\"id\":\"felfktg\",\"name\":\"lcrpw\",\"type\":\"xeznoi\"}]}"; + = "{\"value\":[{\"properties\":{\"state\":\"Active\",\"format\":\"dpsqx\",\"storageUrl\":\"psvuoymgc\",\"storageUrlExpiry\":\"2021-08-18T08:31:36Z\",\"lastActivationTime\":\"2021-01-01T10:52:13Z\"},\"etag\":\"rypqlmfeo\",\"id\":\"erqwkyhkobopg\",\"name\":\"edkowepbqpcrfk\",\"type\":\"wccsnjvcdwxlpqek\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -48,8 +48,8 @@ public void testList() throws Exception { tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = manager.applicationPackages().list("s", "ronzmyhgfip", "sxkm", - 2130942717, com.azure.core.util.Context.NONE); + PagedIterable response = manager.applicationPackages().list("hwyg", "lvdnkfx", "semdwzrmu", + 114396091, com.azure.core.util.Context.NONE); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationsCreateWithResponseMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationsCreateWithResponseMockTests.java index 2a9bb29d84c6b..aae7b66c37efb 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationsCreateWithResponseMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationsCreateWithResponseMockTests.java @@ -31,7 +31,7 @@ public void testCreateWithResponse() throws Exception { ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); String responseStr - = "{\"properties\":{\"displayName\":\"zejntps\",\"allowUpdates\":false,\"defaultVersion\":\"oi\"},\"etag\":\"ukry\",\"id\":\"xtqmieoxor\",\"name\":\"gufhyaomtbg\",\"type\":\"havgrvk\"}"; + = "{\"properties\":{\"displayName\":\"txhojujb\",\"allowUpdates\":true,\"defaultVersion\":\"mc\"},\"etag\":\"hixbjxyfwnyl\",\"id\":\"coolsttpkiwkkb\",\"name\":\"ujrywvtyl\",\"type\":\"fpncurdo\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -48,11 +48,11 @@ public void testCreateWithResponse() throws Exception { tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - Application response = manager.applications().define("lgnyhmo").withExistingBatchAccount("tw", "sgogczhonnxk") - .withDisplayName("kkgthr").withAllowUpdates(true).withDefaultVersion("jbdhqxvc").create(); + Application response = manager.applications().define("aays").withExistingBatchAccount("ou", "ibreb") + .withDisplayName("xqtnq").withAllowUpdates(false).withDefaultVersion("lwfffi").create(); - Assertions.assertEquals("zejntps", response.displayName()); - Assertions.assertEquals(false, response.allowUpdates()); - Assertions.assertEquals("oi", response.defaultVersion()); + Assertions.assertEquals("txhojujb", response.displayName()); + Assertions.assertEquals(true, response.allowUpdates()); + Assertions.assertEquals("mc", response.defaultVersion()); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationsDeleteWithResponseMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationsDeleteWithResponseMockTests.java index ccbf6bb90f703..6da9dea6a26a5 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationsDeleteWithResponseMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationsDeleteWithResponseMockTests.java @@ -45,8 +45,7 @@ public void testDeleteWithResponse() throws Exception { tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.applications().deleteWithResponse("hfstotxhojujbyp", "lmcuvhixb", "xyfwnylrcool", - com.azure.core.util.Context.NONE); + manager.applications().deleteWithResponse("grhbpn", "ixexcc", "dreaxh", com.azure.core.util.Context.NONE); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationsGetWithResponseMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationsGetWithResponseMockTests.java index bc192778bb201..2cf6598896a8e 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationsGetWithResponseMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationsGetWithResponseMockTests.java @@ -31,7 +31,7 @@ public void testGetWithResponse() throws Exception { ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); String responseStr - = "{\"properties\":{\"displayName\":\"ithtywu\",\"allowUpdates\":false,\"defaultVersion\":\"ihwqknfdntwjchr\"},\"etag\":\"oihxumwctondzjlu\",\"id\":\"dfdlwggyts\",\"name\":\"wtovvtgsein\",\"type\":\"fiufx\"}"; + = "{\"properties\":{\"displayName\":\"t\",\"allowUpdates\":false,\"defaultVersion\":\"pyostronzmyhgfi\"},\"etag\":\"sxkm\",\"id\":\"waekrrjreafxtsgu\",\"name\":\"hjglikk\",\"type\":\"wslolbqp\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -49,10 +49,10 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); Application response = manager.applications() - .getWithResponse("ttpkiwkkbnujrywv", "y", "bfpncurdo", com.azure.core.util.Context.NONE).getValue(); + .getWithResponse("exdrrvqahqkg", "tpwijnh", "jsvfycxzbfvoowv", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("ithtywu", response.displayName()); + Assertions.assertEquals("t", response.displayName()); Assertions.assertEquals(false, response.allowUpdates()); - Assertions.assertEquals("ihwqknfdntwjchr", response.defaultVersion()); + Assertions.assertEquals("pyostronzmyhgfi", response.defaultVersion()); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationsListMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationsListMockTests.java index a15d305814d72..6b36791995a8e 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationsListMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ApplicationsListMockTests.java @@ -32,7 +32,7 @@ public void testList() throws Exception { ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); String responseStr - = "{\"value\":[{\"properties\":{\"displayName\":\"r\",\"allowUpdates\":true,\"defaultVersion\":\"ijnkrxfrdd\"},\"etag\":\"ratiz\",\"id\":\"ronasxift\",\"name\":\"zq\",\"type\":\"zh\"}]}"; + = "{\"value\":[{\"properties\":{\"displayName\":\"pwjxezn\",\"allowUpdates\":false,\"defaultVersion\":\"rnjwmw\"},\"etag\":\"nbsazejjoqkag\",\"id\":\"hsxttaugzxnf\",\"name\":\"azpxdtnkdmkqjjl\",\"type\":\"uenvrkp\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -50,10 +50,10 @@ public void testList() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.applications().list("knpirgnepttwq", "sniffc", 1105957042, com.azure.core.util.Context.NONE); + = manager.applications().list("uzlm", "felfktg", 1170728394, com.azure.core.util.Context.NONE); - Assertions.assertEquals("r", response.iterator().next().displayName()); - Assertions.assertEquals(true, response.iterator().next().allowUpdates()); - Assertions.assertEquals("ijnkrxfrdd", response.iterator().next().defaultVersion()); + Assertions.assertEquals("pwjxezn", response.iterator().next().displayName()); + Assertions.assertEquals(false, response.iterator().next().allowUpdates()); + Assertions.assertEquals("rnjwmw", response.iterator().next().defaultVersion()); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/AutomaticOSUpgradePolicyTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/AutomaticOSUpgradePolicyTests.java new file mode 100644 index 0000000000000..562ab12ce8f9b --- /dev/null +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/AutomaticOSUpgradePolicyTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.batch.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.batch.models.AutomaticOSUpgradePolicy; +import org.junit.jupiter.api.Assertions; + +public final class AutomaticOSUpgradePolicyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AutomaticOSUpgradePolicy model = BinaryData.fromString( + "{\"disableAutomaticRollback\":true,\"enableAutomaticOSUpgrade\":true,\"useRollingUpgradePolicy\":true,\"osRollingUpgradeDeferral\":false}") + .toObject(AutomaticOSUpgradePolicy.class); + Assertions.assertEquals(true, model.disableAutomaticRollback()); + Assertions.assertEquals(true, model.enableAutomaticOSUpgrade()); + Assertions.assertEquals(true, model.useRollingUpgradePolicy()); + Assertions.assertEquals(false, model.osRollingUpgradeDeferral()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AutomaticOSUpgradePolicy model = new AutomaticOSUpgradePolicy().withDisableAutomaticRollback(true) + .withEnableAutomaticOSUpgrade(true).withUseRollingUpgradePolicy(true).withOsRollingUpgradeDeferral(false); + model = BinaryData.fromObject(model).toObject(AutomaticOSUpgradePolicy.class); + Assertions.assertEquals(true, model.disableAutomaticRollback()); + Assertions.assertEquals(true, model.enableAutomaticOSUpgrade()); + Assertions.assertEquals(true, model.useRollingUpgradePolicy()); + Assertions.assertEquals(false, model.osRollingUpgradeDeferral()); + } +} diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsDeleteMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsDeleteMockTests.java index c7750a469eb1e..d5255c48aba32 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsDeleteMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsDeleteMockTests.java @@ -45,7 +45,7 @@ public void testDelete() throws Exception { tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.batchAccounts().delete("cccnxqhuexmktt", "stvlzywemhzrnc", com.azure.core.util.Context.NONE); + manager.batchAccounts().delete("ngqqmoakuf", "m", com.azure.core.util.Context.NONE); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsGetDetectorWithResponseMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsGetDetectorWithResponseMockTests.java index b249813a232ae..c64613103d0a5 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsGetDetectorWithResponseMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsGetDetectorWithResponseMockTests.java @@ -31,7 +31,7 @@ public void testGetDetectorWithResponse() throws Exception { ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); String responseStr - = "{\"properties\":{\"value\":\"j\"},\"etag\":\"nlfzxiavrmbz\",\"id\":\"nokixrjqcirgz\",\"name\":\"frl\",\"type\":\"zszrnwoiindfpw\"}"; + = "{\"properties\":{\"value\":\"wxqibyq\"},\"etag\":\"y\",\"id\":\"wxwlmdjrkvfgb\",\"name\":\"fvpdbo\",\"type\":\"acizsjqlhkrr\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -49,9 +49,8 @@ public void testGetDetectorWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); DetectorResponse response = manager.batchAccounts() - .getDetectorWithResponse("zpdrhneu", "owqkdwytisi", "ircgpikpz", com.azure.core.util.Context.NONE) - .getValue(); + .getDetectorWithResponse("nmdyodnwzxl", "jc", "nhltiugcxn", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("j", response.value()); + Assertions.assertEquals("wxqibyq", response.value()); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsGetKeysWithResponseMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsGetKeysWithResponseMockTests.java index 81b311c479944..09630782559ba 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsGetKeysWithResponseMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsGetKeysWithResponseMockTests.java @@ -29,8 +29,7 @@ public void testGetKeysWithResponse() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"accountName\":\"abudurgk\",\"primary\":\"mokzhjjklf\",\"secondary\":\"mouwqlgzrfzeey\"}"; + String responseStr = "{\"accountName\":\"sx\",\"primary\":\"pelol\",\"secondary\":\"vk\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -48,7 +47,7 @@ public void testGetKeysWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); BatchAccountKeys response = manager.batchAccounts() - .getKeysWithResponse("tawfsdjpvkvp", "jxbkzbzkdvn", com.azure.core.util.Context.NONE).getValue(); + .getKeysWithResponse("sfgytguslfead", "ygqukyhejh", com.azure.core.util.Context.NONE).getValue(); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsListDetectorsMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsListDetectorsMockTests.java index c729a65ad502e..93b11fd78e601 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsListDetectorsMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsListDetectorsMockTests.java @@ -32,7 +32,7 @@ public void testListDetectors() throws Exception { ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); String responseStr - = "{\"value\":[{\"properties\":{\"value\":\"vtldgmfpgvmpip\"},\"etag\":\"ltha\",\"id\":\"fxssm\",\"name\":\"u\",\"type\":\"wbdsr\"}]}"; + = "{\"value\":[{\"properties\":{\"value\":\"iby\"},\"etag\":\"dl\",\"id\":\"h\",\"name\":\"hfwpracstwit\",\"type\":\"khevxccedc\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -50,8 +50,8 @@ public void testListDetectors() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.batchAccounts().listDetectors("bizikayuhq", "bjbsybb", com.azure.core.util.Context.NONE); + = manager.batchAccounts().listDetectors("r", "qvujzraehtwdwrf", com.azure.core.util.Context.NONE); - Assertions.assertEquals("vtldgmfpgvmpip", response.iterator().next().value()); + Assertions.assertEquals("iby", response.iterator().next().value()); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsListOutboundNetworkDependenciesEndpointsMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsListOutboundNetworkDependenciesEndpointsMockTests.java index ae30548c6f1c5..b44ad7e627313 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsListOutboundNetworkDependenciesEndpointsMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsListOutboundNetworkDependenciesEndpointsMockTests.java @@ -31,7 +31,7 @@ public void testListOutboundNetworkDependenciesEndpoints() throws Exception { ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); String responseStr - = "{\"value\":[{\"category\":\"gofel\",\"endpoints\":[{\"domainName\":\"qmqhldvriii\",\"description\":\"nalghfkvtvsexso\",\"endpointDetails\":[{\"port\":750613603}]},{\"domainName\":\"hhahhxvrhmzkwpjg\",\"description\":\"spughftqsxhq\",\"endpointDetails\":[{\"port\":1043594418}]},{\"domainName\":\"ndxdigrjguufzdm\",\"description\":\"qtfihwhbotzinga\",\"endpointDetails\":[{\"port\":313573135}]}]}]}"; + = "{\"value\":[{\"category\":\"wkqnyhg\",\"endpoints\":[{\"domainName\":\"jivfxzsjabib\",\"description\":\"stawfsdjpvkv\",\"endpointDetails\":[{\"port\":1731157683},{\"port\":2005315516},{\"port\":2094987442}]}]}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -48,8 +48,9 @@ public void testListOutboundNetworkDependenciesEndpoints() throws Exception { tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = manager.batchAccounts() - .listOutboundNetworkDependenciesEndpoints("jylwbtlhflsj", "dhszfjv", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.batchAccounts().listOutboundNetworkDependenciesEndpoints("bdeibqipqk", "hvxndzwmkrefajpj", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsSynchronizeAutoStorageKeysWithResponseMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsSynchronizeAutoStorageKeysWithResponseMockTests.java index 00059fc180263..6536da3ee7cd7 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsSynchronizeAutoStorageKeysWithResponseMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchAccountsSynchronizeAutoStorageKeysWithResponseMockTests.java @@ -45,7 +45,7 @@ public void testSynchronizeAutoStorageKeysWithResponse() throws Exception { tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.batchAccounts().synchronizeAutoStorageKeysWithResponse("hvxndzwmkrefajpj", "rwkq", + manager.batchAccounts().synchronizeAutoStorageKeysWithResponse("xggicccnxqhuexmk", "tlstvlzywem", com.azure.core.util.Context.NONE); } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchPoolIdentityTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchPoolIdentityTests.java index e0c59247d599a..8f8da926fc6bf 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchPoolIdentityTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/BatchPoolIdentityTests.java @@ -16,16 +16,16 @@ public final class BatchPoolIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { BatchPoolIdentity model = BinaryData.fromString( - "{\"type\":\"None\",\"userAssignedIdentities\":{\"dxrbuukzcle\":{\"principalId\":\"kfzbeyvpnqicvi\",\"clientId\":\"kjj\"},\"qa\":{\"principalId\":\"hmlwpaztzpo\",\"clientId\":\"cckwyfzqwhxxbu\"},\"obqwcsdbnwdcfh\":{\"principalId\":\"feqztppriol\",\"clientId\":\"rjaltolmncw\"}}}") + "{\"type\":\"None\",\"userAssignedIdentities\":{\"ppriol\":{\"principalId\":\"whxxbuyqax\",\"clientId\":\"eqz\"},\"ucqdpfuvglsb\":{\"principalId\":\"rjaltolmncw\",\"clientId\":\"bqwcsdbnwdcf\"},\"ncormrlxqtvcof\":{\"principalId\":\"ca\",\"clientId\":\"xbvtvudu\"},\"n\":{\"principalId\":\"f\",\"clientId\":\"kgjubgdknnqvsazn\"}}}") .toObject(BatchPoolIdentity.class); Assertions.assertEquals(PoolIdentityType.NONE, model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - BatchPoolIdentity model = new BatchPoolIdentity().withType(PoolIdentityType.NONE) - .withUserAssignedIdentities(mapOf("dxrbuukzcle", new UserAssignedIdentities(), "qa", - new UserAssignedIdentities(), "obqwcsdbnwdcfh", new UserAssignedIdentities())); + BatchPoolIdentity model = new BatchPoolIdentity().withType(PoolIdentityType.NONE).withUserAssignedIdentities( + mapOf("ppriol", new UserAssignedIdentities(), "ucqdpfuvglsb", new UserAssignedIdentities(), + "ncormrlxqtvcof", new UserAssignedIdentities(), "n", new UserAssignedIdentities())); model = BinaryData.fromObject(model).toObject(BatchPoolIdentity.class); Assertions.assertEquals(PoolIdentityType.NONE, model.type()); } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/CertificateBasePropertiesTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/CertificateBasePropertiesTests.java index a173f0d6f7973..7e01a08829471 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/CertificateBasePropertiesTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/CertificateBasePropertiesTests.java @@ -13,20 +13,20 @@ public final class CertificateBasePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CertificateBaseProperties model = BinaryData - .fromString("{\"thumbprintAlgorithm\":\"tki\",\"thumbprint\":\"xhqyudxorrqnb\",\"format\":\"Pfx\"}") + .fromString("{\"thumbprintAlgorithm\":\"mdectehfiqscjey\",\"thumbprint\":\"hezrkgq\",\"format\":\"Cer\"}") .toObject(CertificateBaseProperties.class); - Assertions.assertEquals("tki", model.thumbprintAlgorithm()); - Assertions.assertEquals("xhqyudxorrqnb", model.thumbprint()); - Assertions.assertEquals(CertificateFormat.PFX, model.format()); + Assertions.assertEquals("mdectehfiqscjey", model.thumbprintAlgorithm()); + Assertions.assertEquals("hezrkgq", model.thumbprint()); + Assertions.assertEquals(CertificateFormat.CER, model.format()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CertificateBaseProperties model = new CertificateBaseProperties().withThumbprintAlgorithm("tki") - .withThumbprint("xhqyudxorrqnb").withFormat(CertificateFormat.PFX); + CertificateBaseProperties model = new CertificateBaseProperties().withThumbprintAlgorithm("mdectehfiqscjey") + .withThumbprint("hezrkgq").withFormat(CertificateFormat.CER); model = BinaryData.fromObject(model).toObject(CertificateBaseProperties.class); - Assertions.assertEquals("tki", model.thumbprintAlgorithm()); - Assertions.assertEquals("xhqyudxorrqnb", model.thumbprint()); - Assertions.assertEquals(CertificateFormat.PFX, model.format()); + Assertions.assertEquals("mdectehfiqscjey", model.thumbprintAlgorithm()); + Assertions.assertEquals("hezrkgq", model.thumbprint()); + Assertions.assertEquals(CertificateFormat.CER, model.format()); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/CertificatesDeleteMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/CertificatesDeleteMockTests.java index 2d674b1019a46..8ad808c57ee54 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/CertificatesDeleteMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/CertificatesDeleteMockTests.java @@ -45,7 +45,7 @@ public void testDelete() throws Exception { tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.certificates().delete("novqfzge", "jdftuljltd", "ceamtm", com.azure.core.util.Context.NONE); + manager.certificates().delete("bgye", "rymsgaojfmw", "cotmr", com.azure.core.util.Context.NONE); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/CheckNameAvailabilityParametersTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/CheckNameAvailabilityParametersTests.java index 417d030d8deac..4e498e8257fd8 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/CheckNameAvailabilityParametersTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/CheckNameAvailabilityParametersTests.java @@ -12,14 +12,14 @@ public final class CheckNameAvailabilityParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CheckNameAvailabilityParameters model - = BinaryData.fromString("{\"name\":\"cczsq\"}").toObject(CheckNameAvailabilityParameters.class); - Assertions.assertEquals("cczsq", model.name()); + = BinaryData.fromString("{\"name\":\"cftadeh\"}").toObject(CheckNameAvailabilityParameters.class); + Assertions.assertEquals("cftadeh", model.name()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CheckNameAvailabilityParameters model = new CheckNameAvailabilityParameters().withName("cczsq"); + CheckNameAvailabilityParameters model = new CheckNameAvailabilityParameters().withName("cftadeh"); model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityParameters.class); - Assertions.assertEquals("cczsq", model.name()); + Assertions.assertEquals("cftadeh", model.name()); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/CheckNameAvailabilityResultInnerTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/CheckNameAvailabilityResultInnerTests.java index 5c934faa58361..917e73d354018 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/CheckNameAvailabilityResultInnerTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/CheckNameAvailabilityResultInnerTests.java @@ -11,7 +11,7 @@ public final class CheckNameAvailabilityResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CheckNameAvailabilityResultInner model - = BinaryData.fromString("{\"nameAvailable\":true,\"reason\":\"Invalid\",\"message\":\"ajvnysounqe\"}") + = BinaryData.fromString("{\"nameAvailable\":false,\"reason\":\"Invalid\",\"message\":\"sop\"}") .toObject(CheckNameAvailabilityResultInner.class); } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/DetectorListResultTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/DetectorListResultTests.java index 213227942e5a6..495633c536052 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/DetectorListResultTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/DetectorListResultTests.java @@ -14,19 +14,20 @@ public final class DetectorListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DetectorListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"value\":\"spkwlhzdobpxjm\"},\"etag\":\"bvvnchrkcciw\",\"id\":\"zjuqkhrsaj\",\"name\":\"wkuofoskghsauu\",\"type\":\"mjmvxieduugidyjr\"},{\"properties\":{\"value\":\"y\"},\"etag\":\"svexcsonpclhoco\",\"id\":\"slkevle\",\"name\":\"gz\",\"type\":\"buhfmvfaxkffeiit\"}],\"nextLink\":\"vmezy\"}") + "{\"value\":[{\"properties\":{\"value\":\"q\"},\"etag\":\"a\",\"id\":\"oaeupfhyhltrpmo\",\"name\":\"jmcmatuokthfu\",\"type\":\"uaodsfcpk\"},{\"properties\":{\"value\":\"dpuozmyz\"},\"etag\":\"agfuaxbezyiu\",\"id\":\"kktwhrdxw\",\"name\":\"ywqsmbsurexim\",\"type\":\"ryocfsfksymdd\"},{\"properties\":{\"value\":\"kiiuxhqyudxor\"},\"etag\":\"nbpoczvyifqrvkdv\",\"id\":\"sllr\",\"name\":\"vvdfwatkpnpul\",\"type\":\"xxbczwtr\"}],\"nextLink\":\"iqzbq\"}") .toObject(DetectorListResult.class); - Assertions.assertEquals("spkwlhzdobpxjm", model.value().get(0).value()); - Assertions.assertEquals("vmezy", model.nextLink()); + Assertions.assertEquals("q", model.value().get(0).value()); + Assertions.assertEquals("iqzbq", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DetectorListResult model - = new DetectorListResult().withValue(Arrays.asList(new DetectorResponseInner().withValue("spkwlhzdobpxjm"), - new DetectorResponseInner().withValue("y"))).withNextLink("vmezy"); + DetectorListResult model = new DetectorListResult().withValue( + Arrays.asList(new DetectorResponseInner().withValue("q"), new DetectorResponseInner().withValue("dpuozmyz"), + new DetectorResponseInner().withValue("kiiuxhqyudxor"))) + .withNextLink("iqzbq"); model = BinaryData.fromObject(model).toObject(DetectorListResult.class); - Assertions.assertEquals("spkwlhzdobpxjm", model.value().get(0).value()); - Assertions.assertEquals("vmezy", model.nextLink()); + Assertions.assertEquals("q", model.value().get(0).value()); + Assertions.assertEquals("iqzbq", model.nextLink()); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/DetectorResponseInnerTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/DetectorResponseInnerTests.java index fce80d78707f4..935e4a87e7a55 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/DetectorResponseInnerTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/DetectorResponseInnerTests.java @@ -12,15 +12,15 @@ public final class DetectorResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DetectorResponseInner model = BinaryData.fromString( - "{\"properties\":{\"value\":\"xmzsbbzogg\"},\"etag\":\"rxwburv\",\"id\":\"xxjnspydptk\",\"name\":\"enkouknvudw\",\"type\":\"iukbldngkpoci\"}") + "{\"properties\":{\"value\":\"ovm\"},\"etag\":\"kacspkw\",\"id\":\"hzdobpxjmflbvvnc\",\"name\":\"rkcciwwzjuqk\",\"type\":\"rsa\"}") .toObject(DetectorResponseInner.class); - Assertions.assertEquals("xmzsbbzogg", model.value()); + Assertions.assertEquals("ovm", model.value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DetectorResponseInner model = new DetectorResponseInner().withValue("xmzsbbzogg"); + DetectorResponseInner model = new DetectorResponseInner().withValue("ovm"); model = BinaryData.fromObject(model).toObject(DetectorResponseInner.class); - Assertions.assertEquals("xmzsbbzogg", model.value()); + Assertions.assertEquals("ovm", model.value()); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/DetectorResponsePropertiesTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/DetectorResponsePropertiesTests.java index 061c29da869d5..329ecb2e5f644 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/DetectorResponsePropertiesTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/DetectorResponsePropertiesTests.java @@ -12,14 +12,14 @@ public final class DetectorResponsePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DetectorResponseProperties model - = BinaryData.fromString("{\"value\":\"z\"}").toObject(DetectorResponseProperties.class); - Assertions.assertEquals("z", model.value()); + = BinaryData.fromString("{\"value\":\"wkuofoskghsauu\"}").toObject(DetectorResponseProperties.class); + Assertions.assertEquals("wkuofoskghsauu", model.value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DetectorResponseProperties model = new DetectorResponseProperties().withValue("z"); + DetectorResponseProperties model = new DetectorResponseProperties().withValue("wkuofoskghsauu"); model = BinaryData.fromObject(model).toObject(DetectorResponseProperties.class); - Assertions.assertEquals("z", model.value()); + Assertions.assertEquals("wkuofoskghsauu", model.value()); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/EndpointDependencyTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/EndpointDependencyTests.java index 7c02e4a58f271..9533f87d55e9c 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/EndpointDependencyTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/EndpointDependencyTests.java @@ -11,7 +11,7 @@ public final class EndpointDependencyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { EndpointDependency model = BinaryData.fromString( - "{\"domainName\":\"luhczbw\",\"description\":\"hairsbrgzdwms\",\"endpointDetails\":[{\"port\":151812446},{\"port\":2076786264},{\"port\":840450646}]}") + "{\"domainName\":\"akgtdlmkkzevdlh\",\"description\":\"pusdstt\",\"endpointDetails\":[{\"port\":221713689},{\"port\":1374887959},{\"port\":2086607804}]}") .toObject(EndpointDependency.class); } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/EndpointDetailTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/EndpointDetailTests.java index b0f32953de99e..4a700d2eaeb98 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/EndpointDetailTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/EndpointDetailTests.java @@ -10,7 +10,7 @@ public final class EndpointDetailTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - EndpointDetail model = BinaryData.fromString("{\"port\":1308163389}").toObject(EndpointDetail.class); + EndpointDetail model = BinaryData.fromString("{\"port\":1690092543}").toObject(EndpointDetail.class); } @org.junit.jupiter.api.Test diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ListPrivateLinkResourcesResultTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ListPrivateLinkResourcesResultTests.java index 41a4915fa9a5b..be5fb909f8e2c 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ListPrivateLinkResourcesResultTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/ListPrivateLinkResourcesResultTests.java @@ -14,7 +14,7 @@ public final class ListPrivateLinkResourcesResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ListPrivateLinkResourcesResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"groupId\":\"ukgjnpiucgygevq\",\"requiredMembers\":[\"yp\",\"rbpizc\",\"r\",\"j\"],\"requiredZoneNames\":[\"ydnfyhxdeoejz\"]},\"etag\":\"w\",\"id\":\"fsj\",\"name\":\"tgzfbishcbkh\",\"type\":\"jdeyeamdpha\"}],\"nextLink\":\"lpbuxwgipwhonowk\"}") + "{\"value\":[{\"properties\":{\"groupId\":\"xieduugidyjrr\",\"requiredMembers\":[\"aos\"],\"requiredZoneNames\":[\"csonpclhoco\"]},\"etag\":\"lkevle\",\"id\":\"gz\",\"name\":\"buhfmvfaxkffeiit\",\"type\":\"lvmezyvshxmzsbbz\"},{\"properties\":{\"groupId\":\"igrxwburvjxxjn\",\"requiredMembers\":[\"dptkoenkouk\",\"vudwtiukbldng\"],\"requiredZoneNames\":[\"cipazyxoegukgjnp\",\"ucgygevqz\",\"typmrbpizcdrqjsd\"]},\"etag\":\"dnfyhxdeoejzicwi\",\"id\":\"sjttgzfbish\",\"name\":\"bkh\",\"type\":\"jdeyeamdpha\"}],\"nextLink\":\"lpbuxwgipwhonowk\"}") .toObject(ListPrivateLinkResourcesResult.class); Assertions.assertEquals("lpbuxwgipwhonowk", model.nextLink()); } @@ -22,7 +22,8 @@ public void testDeserialize() throws Exception { @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ListPrivateLinkResourcesResult model = new ListPrivateLinkResourcesResult() - .withValue(Arrays.asList(new PrivateLinkResourceInner())).withNextLink("lpbuxwgipwhonowk"); + .withValue(Arrays.asList(new PrivateLinkResourceInner(), new PrivateLinkResourceInner())) + .withNextLink("lpbuxwgipwhonowk"); model = BinaryData.fromObject(model).toObject(ListPrivateLinkResourcesResult.class); Assertions.assertEquals("lpbuxwgipwhonowk", model.nextLink()); } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/LocationsCheckNameAvailabilityWithResponseMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/LocationsCheckNameAvailabilityWithResponseMockTests.java index 0f96c65c9aeb1..51e1a9f2c7fb4 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/LocationsCheckNameAvailabilityWithResponseMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/LocationsCheckNameAvailabilityWithResponseMockTests.java @@ -30,7 +30,7 @@ public void testCheckNameAvailabilityWithResponse() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"nameAvailable\":false,\"reason\":\"AlreadyExists\",\"message\":\"sutrgjup\"}"; + String responseStr = "{\"nameAvailable\":true,\"reason\":\"AlreadyExists\",\"message\":\"qg\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -47,8 +47,11 @@ public void testCheckNameAvailabilityWithResponse() throws Exception { tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - CheckNameAvailabilityResult response = manager.locations().checkNameAvailabilityWithResponse("xifqjzgxm", - new CheckNameAvailabilityParameters().withName("hu"), com.azure.core.util.Context.NONE).getValue(); + CheckNameAvailabilityResult response + = manager.locations() + .checkNameAvailabilityWithResponse("swdvzyybycnun", + new CheckNameAvailabilityParameters().withName("jsrtk"), com.azure.core.util.Context.NONE) + .getValue(); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/LocationsGetQuotasWithResponseMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/LocationsGetQuotasWithResponseMockTests.java index e66cd25220b8f..da9bf35900117 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/LocationsGetQuotasWithResponseMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/LocationsGetQuotasWithResponseMockTests.java @@ -29,7 +29,7 @@ public void testGetQuotasWithResponse() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"accountQuota\":284143566}"; + String responseStr = "{\"accountQuota\":709721668}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -47,7 +47,7 @@ public void testGetQuotasWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); BatchLocationQuota response - = manager.locations().getQuotasWithResponse("fo", com.azure.core.util.Context.NONE).getValue(); + = manager.locations().getQuotasWithResponse("wiithtywub", com.azure.core.util.Context.NONE).getValue(); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/LocationsListSupportedCloudServiceSkusMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/LocationsListSupportedCloudServiceSkusMockTests.java index c9d4346e4e8c6..efc6328c168f6 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/LocationsListSupportedCloudServiceSkusMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/LocationsListSupportedCloudServiceSkusMockTests.java @@ -31,7 +31,7 @@ public void testListSupportedCloudServiceSkus() throws Exception { ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); String responseStr - = "{\"value\":[{\"name\":\"cpqjlihhyu\",\"familyName\":\"skasdvlmfwdgzxu\",\"capabilities\":[{\"name\":\"pamrsr\",\"value\":\"zvxurisjnhny\"}]}]}"; + = "{\"value\":[{\"name\":\"tizzronasxif\",\"familyName\":\"zq\",\"capabilities\":[{\"name\":\"tw\",\"value\":\"gogczhonnxkrlgny\"},{\"name\":\"ossxk\",\"value\":\"thrrgh\"},{\"name\":\"bdhqxvcxgf\",\"value\":\"dsofbshrns\"}],\"batchSupportEndOfLife\":\"2021-07-30T15:10:49Z\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -48,8 +48,8 @@ public void testListSupportedCloudServiceSkus() throws Exception { tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = manager.locations().listSupportedCloudServiceSkus("tymoxoftp", - 1701654181, "iwyczuh", com.azure.core.util.Context.NONE); + PagedIterable response = manager.locations().listSupportedCloudServiceSkus("qnrojlpijnkrxfrd", + 1333681706, "c", com.azure.core.util.Context.NONE); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/LocationsListSupportedVirtualMachineSkusMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/LocationsListSupportedVirtualMachineSkusMockTests.java index 1b82cb8c0e41e..03cac32e4c753 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/LocationsListSupportedVirtualMachineSkusMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/LocationsListSupportedVirtualMachineSkusMockTests.java @@ -31,7 +31,7 @@ public void testListSupportedVirtualMachineSkus() throws Exception { ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); String responseStr - = "{\"value\":[{\"name\":\"bkfezzxscyhwzdgi\",\"familyName\":\"jbzbomvzzbtdcq\",\"capabilities\":[{\"name\":\"yujviylwdshfssn\",\"value\":\"gy\"},{\"name\":\"rymsgaojfmw\",\"value\":\"otmrfhir\"}]}]}"; + = "{\"value\":[{\"name\":\"fdlwg\",\"familyName\":\"tsbwtovvtgse\",\"capabilities\":[{\"name\":\"iufxqknpir\",\"value\":\"epttwqmsniff\"}],\"batchSupportEndOfLife\":\"2021-10-31T18:45:45Z\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -48,8 +48,8 @@ public void testListSupportedVirtualMachineSkus() throws Exception { tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = manager.locations().listSupportedVirtualMachineSkus("hpjbib", 1956695064, - "mfxumvfcluyovw", com.azure.core.util.Context.NONE); + PagedIterable response = manager.locations().listSupportedVirtualMachineSkus("ihwqknfdntwjchr", + 1139414595, "oihxumwctondzjlu", com.azure.core.util.Context.NONE); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OperationDisplayTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OperationDisplayTests.java index 70758bcd06b95..13fb49cecd22f 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OperationDisplayTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OperationDisplayTests.java @@ -12,22 +12,22 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"mdectehfiqscjey\",\"operation\":\"hezrkgq\",\"resource\":\"jrefovgmkqsle\",\"description\":\"vxyqjpkcattpngjc\"}") + "{\"provider\":\"gual\",\"operation\":\"xxhejjzzvd\",\"resource\":\"gwdslfhotwm\",\"description\":\"npwlbjnpg\"}") .toObject(OperationDisplay.class); - Assertions.assertEquals("mdectehfiqscjey", model.provider()); - Assertions.assertEquals("hezrkgq", model.operation()); - Assertions.assertEquals("jrefovgmkqsle", model.resource()); - Assertions.assertEquals("vxyqjpkcattpngjc", model.description()); + Assertions.assertEquals("gual", model.provider()); + Assertions.assertEquals("xxhejjzzvd", model.operation()); + Assertions.assertEquals("gwdslfhotwm", model.resource()); + Assertions.assertEquals("npwlbjnpg", model.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("mdectehfiqscjey").withOperation("hezrkgq") - .withResource("jrefovgmkqsle").withDescription("vxyqjpkcattpngjc"); + OperationDisplay model = new OperationDisplay().withProvider("gual").withOperation("xxhejjzzvd") + .withResource("gwdslfhotwm").withDescription("npwlbjnpg"); model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("mdectehfiqscjey", model.provider()); - Assertions.assertEquals("hezrkgq", model.operation()); - Assertions.assertEquals("jrefovgmkqsle", model.resource()); - Assertions.assertEquals("vxyqjpkcattpngjc", model.description()); + Assertions.assertEquals("gual", model.provider()); + Assertions.assertEquals("xxhejjzzvd", model.operation()); + Assertions.assertEquals("gwdslfhotwm", model.resource()); + Assertions.assertEquals("npwlbjnpg", model.description()); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OperationInnerTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OperationInnerTests.java index 5f6d13fed664c..ba154f1214331 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OperationInnerTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OperationInnerTests.java @@ -13,30 +13,30 @@ public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationInner model = BinaryData.fromString( - "{\"name\":\"dnvowg\",\"isDataAction\":true,\"display\":{\"provider\":\"wdkcglhsl\",\"operation\":\"jdyggdtji\",\"resource\":\"b\",\"description\":\"ofqweykhmenevfye\"},\"origin\":\"whybcib\",\"properties\":\"datavdcsitynn\"}") + "{\"name\":\"lnwsubisn\",\"isDataAction\":true,\"display\":{\"provider\":\"ngnzscxaqwoochc\",\"operation\":\"nqvpkvlrxnje\",\"resource\":\"eipheoflokeyy\",\"description\":\"nj\"},\"origin\":\"lwtgrhpdj\",\"properties\":\"dataumasxazjpq\"}") .toObject(OperationInner.class); - Assertions.assertEquals("dnvowg", model.name()); + Assertions.assertEquals("lnwsubisn", model.name()); Assertions.assertEquals(true, model.isDataAction()); - Assertions.assertEquals("wdkcglhsl", model.display().provider()); - Assertions.assertEquals("jdyggdtji", model.display().operation()); - Assertions.assertEquals("b", model.display().resource()); - Assertions.assertEquals("ofqweykhmenevfye", model.display().description()); - Assertions.assertEquals("whybcib", model.origin()); + Assertions.assertEquals("ngnzscxaqwoochc", model.display().provider()); + Assertions.assertEquals("nqvpkvlrxnje", model.display().operation()); + Assertions.assertEquals("eipheoflokeyy", model.display().resource()); + Assertions.assertEquals("nj", model.display().description()); + Assertions.assertEquals("lwtgrhpdj", model.origin()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OperationInner model = new OperationInner() - .withName("dnvowg").withIsDataAction(true).withDisplay(new OperationDisplay().withProvider("wdkcglhsl") - .withOperation("jdyggdtji").withResource("b").withDescription("ofqweykhmenevfye")) - .withOrigin("whybcib").withProperties("datavdcsitynn"); + OperationInner model = new OperationInner().withName("lnwsubisn").withIsDataAction(true) + .withDisplay(new OperationDisplay().withProvider("ngnzscxaqwoochc").withOperation("nqvpkvlrxnje") + .withResource("eipheoflokeyy").withDescription("nj")) + .withOrigin("lwtgrhpdj").withProperties("dataumasxazjpq"); model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("dnvowg", model.name()); + Assertions.assertEquals("lnwsubisn", model.name()); Assertions.assertEquals(true, model.isDataAction()); - Assertions.assertEquals("wdkcglhsl", model.display().provider()); - Assertions.assertEquals("jdyggdtji", model.display().operation()); - Assertions.assertEquals("b", model.display().resource()); - Assertions.assertEquals("ofqweykhmenevfye", model.display().description()); - Assertions.assertEquals("whybcib", model.origin()); + Assertions.assertEquals("ngnzscxaqwoochc", model.display().provider()); + Assertions.assertEquals("nqvpkvlrxnje", model.display().operation()); + Assertions.assertEquals("eipheoflokeyy", model.display().resource()); + Assertions.assertEquals("nj", model.display().description()); + Assertions.assertEquals("lwtgrhpdj", model.origin()); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OperationListResultTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OperationListResultTests.java index 62316fe5b9800..108565ab2a0dd 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OperationListResultTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OperationListResultTests.java @@ -15,46 +15,34 @@ public final class OperationListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"ugnxkrxdqmi\",\"isDataAction\":false,\"display\":{\"provider\":\"rvqdra\",\"operation\":\"jybige\",\"resource\":\"qfbow\",\"description\":\"anyktzlcuiywg\"},\"origin\":\"wgndrvynhzgpp\",\"properties\":\"datacgyncocpecf\"},{\"name\":\"mcoo\",\"isDataAction\":true,\"display\":{\"provider\":\"evgbmqjq\",\"operation\":\"c\",\"resource\":\"mivkwlzuvcc\",\"description\":\"nfnbacfionlebxe\"},\"origin\":\"gtzxdpn\",\"properties\":\"dataqqwx\"},{\"name\":\"feallnwsu\",\"isDataAction\":true,\"display\":{\"provider\":\"ampmngnz\",\"operation\":\"xaqwoochcbonqv\",\"resource\":\"vlrxnjeaseiph\",\"description\":\"f\"},\"origin\":\"keyyi\",\"properties\":\"datajbdlwtgrhpdjpju\"},{\"name\":\"sxazjpq\",\"isDataAction\":false,\"display\":{\"provider\":\"lhbxxhejjzzvdud\",\"operation\":\"dslfhotwmcy\",\"resource\":\"wlbjnpgacftade\",\"description\":\"nltyfsoppusuesnz\"},\"origin\":\"ej\",\"properties\":\"datavorxzdmohct\"}],\"nextLink\":\"vudwx\"}") + "{\"value\":[{\"name\":\"ocpecfvmmco\",\"isDataAction\":true,\"display\":{\"provider\":\"zevgb\",\"operation\":\"jqabcypmivkwlzuv\",\"resource\":\"fwnfnb\",\"description\":\"fionl\"},\"origin\":\"x\",\"properties\":\"dataqgtz\"}],\"nextLink\":\"pnqbqqwxrjfe\"}") .toObject(OperationListResult.class); - Assertions.assertEquals("ugnxkrxdqmi", model.value().get(0).name()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("rvqdra", model.value().get(0).display().provider()); - Assertions.assertEquals("jybige", model.value().get(0).display().operation()); - Assertions.assertEquals("qfbow", model.value().get(0).display().resource()); - Assertions.assertEquals("anyktzlcuiywg", model.value().get(0).display().description()); - Assertions.assertEquals("wgndrvynhzgpp", model.value().get(0).origin()); - Assertions.assertEquals("vudwx", model.nextLink()); + Assertions.assertEquals("ocpecfvmmco", model.value().get(0).name()); + Assertions.assertEquals(true, model.value().get(0).isDataAction()); + Assertions.assertEquals("zevgb", model.value().get(0).display().provider()); + Assertions.assertEquals("jqabcypmivkwlzuv", model.value().get(0).display().operation()); + Assertions.assertEquals("fwnfnb", model.value().get(0).display().resource()); + Assertions.assertEquals("fionl", model.value().get(0).display().description()); + Assertions.assertEquals("x", model.value().get(0).origin()); + Assertions.assertEquals("pnqbqqwxrjfe", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult().withValue(Arrays.asList( - new OperationInner().withName("ugnxkrxdqmi").withIsDataAction(false) - .withDisplay(new OperationDisplay().withProvider("rvqdra").withOperation("jybige").withResource("qfbow") - .withDescription("anyktzlcuiywg")) - .withOrigin("wgndrvynhzgpp").withProperties("datacgyncocpecf"), - new OperationInner().withName("mcoo").withIsDataAction(true) - .withDisplay(new OperationDisplay().withProvider("evgbmqjq").withOperation("c") - .withResource("mivkwlzuvcc").withDescription("nfnbacfionlebxe")) - .withOrigin("gtzxdpn").withProperties("dataqqwx"), - new OperationInner().withName("feallnwsu").withIsDataAction(true) - .withDisplay(new OperationDisplay().withProvider("ampmngnz").withOperation("xaqwoochcbonqv") - .withResource("vlrxnjeaseiph").withDescription("f")) - .withOrigin("keyyi").withProperties("datajbdlwtgrhpdjpju"), - new OperationInner().withName("sxazjpq").withIsDataAction(false) - .withDisplay(new OperationDisplay().withProvider("lhbxxhejjzzvdud").withOperation("dslfhotwmcy") - .withResource("wlbjnpgacftade").withDescription("nltyfsoppusuesnz")) - .withOrigin("ej").withProperties("datavorxzdmohct"))) - .withNextLink("vudwx"); + OperationListResult model = new OperationListResult() + .withValue(Arrays.asList(new OperationInner().withName("ocpecfvmmco").withIsDataAction(true) + .withDisplay(new OperationDisplay().withProvider("zevgb").withOperation("jqabcypmivkwlzuv") + .withResource("fwnfnb").withDescription("fionl")) + .withOrigin("x").withProperties("dataqgtz"))) + .withNextLink("pnqbqqwxrjfe"); model = BinaryData.fromObject(model).toObject(OperationListResult.class); - Assertions.assertEquals("ugnxkrxdqmi", model.value().get(0).name()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("rvqdra", model.value().get(0).display().provider()); - Assertions.assertEquals("jybige", model.value().get(0).display().operation()); - Assertions.assertEquals("qfbow", model.value().get(0).display().resource()); - Assertions.assertEquals("anyktzlcuiywg", model.value().get(0).display().description()); - Assertions.assertEquals("wgndrvynhzgpp", model.value().get(0).origin()); - Assertions.assertEquals("vudwx", model.nextLink()); + Assertions.assertEquals("ocpecfvmmco", model.value().get(0).name()); + Assertions.assertEquals(true, model.value().get(0).isDataAction()); + Assertions.assertEquals("zevgb", model.value().get(0).display().provider()); + Assertions.assertEquals("jqabcypmivkwlzuv", model.value().get(0).display().operation()); + Assertions.assertEquals("fwnfnb", model.value().get(0).display().resource()); + Assertions.assertEquals("fionl", model.value().get(0).display().description()); + Assertions.assertEquals("x", model.value().get(0).origin()); + Assertions.assertEquals("pnqbqqwxrjfe", model.nextLink()); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OperationsListMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OperationsListMockTests.java index 59b231c9b1618..6264844b95aa4 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OperationsListMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OperationsListMockTests.java @@ -32,7 +32,7 @@ public void testList() throws Exception { ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); String responseStr - = "{\"value\":[{\"name\":\"utpwoqhihejqgw\",\"isDataAction\":false,\"display\":{\"provider\":\"n\",\"operation\":\"ypsxjvfoim\",\"resource\":\"slirciz\",\"description\":\"vydfceacvlhvygdy\"},\"origin\":\"umrtwnawjsl\",\"properties\":\"datawkojgcyztsfmzn\"}]}"; + = "{\"value\":[{\"name\":\"yzirtxdyuxzejn\",\"isDataAction\":true,\"display\":{\"provider\":\"gioilqu\",\"operation\":\"ydxtqm\",\"resource\":\"ox\",\"description\":\"ggufhyaomtb\"},\"origin\":\"havgrvk\",\"properties\":\"dataovjzhpjbibgjmfx\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -51,12 +51,12 @@ public void testList() throws Exception { PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("utpwoqhihejqgw", response.iterator().next().name()); - Assertions.assertEquals(false, response.iterator().next().isDataAction()); - Assertions.assertEquals("n", response.iterator().next().display().provider()); - Assertions.assertEquals("ypsxjvfoim", response.iterator().next().display().operation()); - Assertions.assertEquals("slirciz", response.iterator().next().display().resource()); - Assertions.assertEquals("vydfceacvlhvygdy", response.iterator().next().display().description()); - Assertions.assertEquals("umrtwnawjsl", response.iterator().next().origin()); + Assertions.assertEquals("yzirtxdyuxzejn", response.iterator().next().name()); + Assertions.assertEquals(true, response.iterator().next().isDataAction()); + Assertions.assertEquals("gioilqu", response.iterator().next().display().provider()); + Assertions.assertEquals("ydxtqm", response.iterator().next().display().operation()); + Assertions.assertEquals("ox", response.iterator().next().display().resource()); + Assertions.assertEquals("ggufhyaomtb", response.iterator().next().display().description()); + Assertions.assertEquals("havgrvk", response.iterator().next().origin()); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OutboundEnvironmentEndpointCollectionTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OutboundEnvironmentEndpointCollectionTests.java index 92fc51b6847ba..f5969aea9151a 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OutboundEnvironmentEndpointCollectionTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OutboundEnvironmentEndpointCollectionTests.java @@ -12,16 +12,16 @@ public final class OutboundEnvironmentEndpointCollectionTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OutboundEnvironmentEndpointCollection model = BinaryData.fromString( - "{\"value\":[{\"category\":\"pfuvglsbjjca\",\"endpoints\":[{\"domainName\":\"vtvudutncormr\",\"description\":\"qtvcofudflvkgj\",\"endpointDetails\":[{},{}]},{\"domainName\":\"knnqvsaznq\",\"description\":\"orudsgsa\",\"endpointDetails\":[{},{},{}]}]},{\"category\":\"c\",\"endpoints\":[{\"domainName\":\"wjue\",\"description\":\"eburu\",\"endpointDetails\":[{},{},{},{}]},{\"domainName\":\"vsmzlxwab\",\"description\":\"oefki\",\"endpointDetails\":[{},{},{}]},{\"domainName\":\"puqujmqlgkfbtn\",\"description\":\"aongbj\",\"endpointDetails\":[{},{},{}]}]},{\"category\":\"jitcjedftwwaez\",\"endpoints\":[{\"domainName\":\"dcpzfoqo\",\"description\":\"cybxa\",\"endpointDetails\":[{},{},{},{}]},{\"domainName\":\"zuf\",\"description\":\"ciqopidoa\",\"endpointDetails\":[{},{},{},{}]},{\"domainName\":\"dhkha\",\"description\":\"khnzbonlw\",\"endpointDetails\":[{},{},{}]},{\"domainName\":\"gokdwbwhks\",\"description\":\"cmrvexzt\",\"endpointDetails\":[{}]}]},{\"category\":\"gsfraoyzkoow\",\"endpoints\":[{\"domainName\":\"guxawqaldsyuuxi\",\"description\":\"rqf\",\"endpointDetails\":[{},{},{}]},{\"domainName\":\"znkbykutwpfhpagm\",\"description\":\"skdsnfdsdoakg\",\"endpointDetails\":[{}]},{\"domainName\":\"kkze\",\"description\":\"l\",\"endpointDetails\":[{},{},{},{}]},{\"domainName\":\"usdsttwv\",\"description\":\"vbbejdcng\",\"endpointDetails\":[{}]}]}],\"nextLink\":\"akufgmjz\"}") + "{\"value\":[{\"category\":\"dsg\",\"endpoints\":[{\"domainName\":\"kycgrauwj\",\"description\":\"taeburuvdm\",\"endpointDetails\":[{}]}]},{\"category\":\"zlxwabmqoefkifr\",\"endpoints\":[{\"domainName\":\"qujmqlgkf\",\"description\":\"ndo\",\"endpointDetails\":[{}]},{\"domainName\":\"bjcntujitc\",\"description\":\"df\",\"endpointDetails\":[{},{},{}]},{\"domainName\":\"ezkojvdcp\",\"description\":\"oqouicybxarzgszu\",\"endpointDetails\":[{}]},{\"domainName\":\"iqopidoamciod\",\"description\":\"haz\",\"endpointDetails\":[{},{}]}]}],\"nextLink\":\"zbonlwnt\"}") .toObject(OutboundEnvironmentEndpointCollection.class); - Assertions.assertEquals("akufgmjz", model.nextLink()); + Assertions.assertEquals("zbonlwnt", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { OutboundEnvironmentEndpointCollection model - = new OutboundEnvironmentEndpointCollection().withNextLink("akufgmjz"); + = new OutboundEnvironmentEndpointCollection().withNextLink("zbonlwnt"); model = BinaryData.fromObject(model).toObject(OutboundEnvironmentEndpointCollection.class); - Assertions.assertEquals("akufgmjz", model.nextLink()); + Assertions.assertEquals("zbonlwnt", model.nextLink()); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OutboundEnvironmentEndpointInnerTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OutboundEnvironmentEndpointInnerTests.java index e63bbcab93a69..2b4e8745ac7d7 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OutboundEnvironmentEndpointInnerTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/OutboundEnvironmentEndpointInnerTests.java @@ -11,7 +11,7 @@ public final class OutboundEnvironmentEndpointInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OutboundEnvironmentEndpointInner model = BinaryData.fromString( - "{\"category\":\"rdgrtw\",\"endpoints\":[{\"domainName\":\"uzkopbminrfd\",\"description\":\"yuhhziu\",\"endpointDetails\":[{\"port\":900012181},{\"port\":1689863270},{\"port\":1792601934},{\"port\":962807389}]},{\"domainName\":\"mzqhoftrmaequi\",\"description\":\"xicslfao\",\"endpointDetails\":[{\"port\":1413149705},{\"port\":2064945633},{\"port\":980018563},{\"port\":1404219514}]},{\"domainName\":\"whccs\",\"description\":\"kaivwit\",\"endpointDetails\":[{\"port\":2016722653},{\"port\":494883497},{\"port\":1839231877}]}]}") + "{\"category\":\"gokdwbwhks\",\"endpoints\":[{\"domainName\":\"rvexztvb\",\"description\":\"gsfraoyzkoow\",\"endpointDetails\":[{\"port\":1663606623},{\"port\":1523878268},{\"port\":1953532777},{\"port\":1275486297}]},{\"domainName\":\"dsyuuximerqfob\",\"description\":\"znkbykutwpfhpagm\",\"endpointDetails\":[{\"port\":1595958724},{\"port\":803916344},{\"port\":1293750730},{\"port\":2086518628}]}]}") .toObject(OutboundEnvironmentEndpointInner.class); } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PoolsDeleteMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PoolsDeleteMockTests.java index 8e5be5b0d7822..567d056e865f9 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PoolsDeleteMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PoolsDeleteMockTests.java @@ -45,7 +45,7 @@ public void testDelete() throws Exception { tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.pools().delete("rriloz", "peewchpxlkt", "kuziycsle", com.azure.core.util.Context.NONE); + manager.pools().delete("yhddvia", "egfnmntfpmvmemfn", "zdwvvbalxl", com.azure.core.util.Context.NONE); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java index e98e40b610aff..a343bfe80d35a 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java @@ -32,7 +32,7 @@ public void testGetWithResponse() throws Exception { ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); String responseStr - = "{\"properties\":{\"provisioningState\":\"Updating\",\"privateEndpoint\":{\"id\":\"vcimpev\"},\"groupIds\":[\"b\",\"rrilbywdxsmic\",\"wrwfscjfnyns\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"i\",\"actionsRequired\":\"voqyt\"}},\"etag\":\"yo\",\"id\":\"bblgyavut\",\"name\":\"thjoxoism\",\"type\":\"ksbpimlqoljx\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{\"id\":\"n\"},\"groupIds\":[\"ewdjcvbquwrb\"],\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"gohbuffkmrq\",\"actionsRequired\":\"vvhmxtdrj\"}},\"etag\":\"tac\",\"id\":\"ebjvewzcjzn\",\"name\":\"wcpmguaadraufac\",\"type\":\"kahzo\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -50,10 +50,10 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PrivateEndpointConnection response = manager.privateEndpointConnections() - .getWithResponse("cubiipuipw", "qonmacj", "k", com.azure.core.util.Context.NONE).getValue(); + .getWithResponse("qybaryeua", "jkqa", "qgzsles", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.APPROVED, + Assertions.assertEquals(PrivateLinkServiceConnectionStatus.REJECTED, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("i", response.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("gohbuffkmrq", response.privateLinkServiceConnectionState().description()); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionsListByBatchAccountMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionsListByBatchAccountMockTests.java index a6287a54012aa..43782611eb8f1 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionsListByBatchAccountMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionsListByBatchAccountMockTests.java @@ -33,7 +33,7 @@ public void testListByBatchAccount() throws Exception { ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{\"id\":\"rsukokwbqplh\"},\"groupIds\":[\"uuepzlrphwzsoldw\",\"yuqdu\",\"vmnnrw\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"rk\",\"actionsRequired\":\"lywjhh\"}},\"etag\":\"nhxmsi\",\"id\":\"fomiloxgg\",\"name\":\"ufiqndieuzaof\",\"type\":\"chvcyyysfgdo\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"privateEndpoint\":{\"id\":\"stvdxeclz\"},\"groupIds\":[\"bcvhzlhpl\",\"dqkdlwwqfbu\",\"lkxt\"],\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"smlmbtxhwgfwsrta\",\"actionsRequired\":\"oezbrhubsk\"}},\"etag\":\"dyg\",\"id\":\"ookk\",\"name\":\"fqjbvleo\",\"type\":\"fmluiqtqzfavyvn\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -51,10 +51,11 @@ public void testListByBatchAccount() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response = manager.privateEndpointConnections() - .listByBatchAccount("epn", "bjcrxgibbdaxco", 456255387, com.azure.core.util.Context.NONE); + .listByBatchAccount("uudl", "zibt", 1621588970, com.azure.core.util.Context.NONE); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.APPROVED, + Assertions.assertEquals(PrivateLinkServiceConnectionStatus.DISCONNECTED, response.iterator().next().privateLinkServiceConnectionState().status()); - Assertions.assertEquals("rk", response.iterator().next().privateLinkServiceConnectionState().description()); + Assertions.assertEquals("smlmbtxhwgfwsrta", + response.iterator().next().privateLinkServiceConnectionState().description()); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionsUpdateMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionsUpdateMockTests.java index 42978594b213b..ce1e7c7853e62 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionsUpdateMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateEndpointConnectionsUpdateMockTests.java @@ -34,7 +34,7 @@ public void testUpdate() throws Exception { ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{\"id\":\"uvscxkdmligov\"},\"groupIds\":[\"xk\",\"mloazuru\",\"cbgoor\",\"te\"],\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"hjxa\",\"actionsRequired\":\"vjgsl\"}},\"etag\":\"dilmyww\",\"id\":\"kgkxn\",\"name\":\"edabgyvudtjue\",\"type\":\"bcihxuuwhc\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{\"id\":\"dnhxmsi\"},\"groupIds\":[\"miloxggdufiqndie\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"fjchvc\",\"actionsRequired\":\"ys\"}},\"etag\":\"dotcubiipuip\",\"id\":\"oqonma\",\"name\":\"jeknizshq\",\"type\":\"cimpevfg\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -52,14 +52,14 @@ public void testUpdate() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PrivateEndpointConnection response - = manager.privateEndpointConnections().update("cgxxlxs", "fgcviz", "zdwlvwlyoupfgfb", + = manager.privateEndpointConnections().update("ajjziuxxpshne", "kulfg", "lqubkwdlen", new PrivateEndpointConnectionInner().withPrivateLinkServiceConnectionState( - new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.APPROVED) - .withDescription("tg")), - "atnwxyiopi", com.azure.core.util.Context.NONE); + new PrivateLinkServiceConnectionState().withStatus(PrivateLinkServiceConnectionStatus.DISCONNECTED) + .withDescription("rxgibbd")), + "biorktal", com.azure.core.util.Context.NONE); - Assertions.assertEquals(PrivateLinkServiceConnectionStatus.DISCONNECTED, + Assertions.assertEquals(PrivateLinkServiceConnectionStatus.APPROVED, response.privateLinkServiceConnectionState().status()); - Assertions.assertEquals("hjxa", response.privateLinkServiceConnectionState().description()); + Assertions.assertEquals("fjchvc", response.privateLinkServiceConnectionState().description()); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateLinkResourcesGetWithResponseMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateLinkResourcesGetWithResponseMockTests.java index 9c5c7cf63c121..dbb842d5d4055 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateLinkResourcesGetWithResponseMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateLinkResourcesGetWithResponseMockTests.java @@ -30,7 +30,7 @@ public void testGetWithResponse() throws Exception { ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); String responseStr - = "{\"properties\":{\"groupId\":\"m\",\"requiredMembers\":[\"mguaadraufa\",\"tkahzo\",\"ajjziuxxpshne\",\"kulfg\"],\"requiredZoneNames\":[\"ubkwdle\",\"rds\"]},\"etag\":\"ujbazpjuohminyfl\",\"id\":\"orwmduvwpklv\",\"name\":\"w\",\"type\":\"ygdxpgpqchis\"}"; + = "{\"properties\":{\"groupId\":\"rvkwc\",\"requiredMembers\":[\"ljyxgtczhe\"],\"requiredZoneNames\":[\"sdshmkxmaehvb\",\"xu\",\"iplt\",\"n\"]},\"etag\":\"baxk\",\"id\":\"xywr\",\"name\":\"kpyklyhp\",\"type\":\"uodpv\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -48,7 +48,7 @@ public void testGetWithResponse() throws Exception { new AzureProfile("", "", AzureEnvironment.AZURE)); PrivateLinkResource response = manager.privateLinkResources() - .getWithResponse("uffkmrqemvvh", "xtdr", "futacoebjvewzc", com.azure.core.util.Context.NONE).getValue(); + .getWithResponse("ejwcwwqiok", "ssxmojms", "p", com.azure.core.util.Context.NONE).getValue(); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateLinkResourcesListByBatchAccountMockTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateLinkResourcesListByBatchAccountMockTests.java index 4d68a1cabacf3..360a3f7a0a86d 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateLinkResourcesListByBatchAccountMockTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/PrivateLinkResourcesListByBatchAccountMockTests.java @@ -31,7 +31,7 @@ public void testListByBatchAccount() throws Exception { ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); String responseStr - = "{\"value\":[{\"properties\":{\"groupId\":\"oookkqfq\",\"requiredMembers\":[\"leorfmluiqtqz\"],\"requiredZoneNames\":[\"yvnqqybaryeuay\",\"kq\"]},\"etag\":\"qgzsles\",\"id\":\"cbhernntiewdj\",\"name\":\"vbquwr\",\"type\":\"ehwagoh\"}]}"; + = "{\"value\":[{\"properties\":{\"groupId\":\"ifmviklbydvk\",\"requiredMembers\":[\"jdz\"],\"requiredZoneNames\":[\"vdsrhnjiv\",\"lvtno\"]},\"etag\":\"fzg\",\"id\":\"mjdftu\",\"name\":\"jltduceam\",\"type\":\"mczuo\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); @@ -48,8 +48,8 @@ public void testListByBatchAccount() throws Exception { tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = manager.privateLinkResources().listByBatchAccount("a", - "coezbrhubskh", 547871572, com.azure.core.util.Context.NONE); + PagedIterable response = manager.privateLinkResources().listByBatchAccount("ztsfmznbaeqp", + "chqnrnrpxehuwry", 1484203808, com.azure.core.util.Context.NONE); } } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/RollingUpgradePolicyTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/RollingUpgradePolicyTests.java new file mode 100644 index 0000000000000..ac2503318ce7a --- /dev/null +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/RollingUpgradePolicyTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.batch.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.batch.models.RollingUpgradePolicy; +import org.junit.jupiter.api.Assertions; + +public final class RollingUpgradePolicyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RollingUpgradePolicy model = BinaryData.fromString( + "{\"enableCrossZoneUpgrade\":true,\"maxBatchInstancePercent\":332964812,\"maxUnhealthyInstancePercent\":969914681,\"maxUnhealthyUpgradedInstancePercent\":1059529277,\"pauseTimeBetweenBatches\":\"zpof\",\"prioritizeUnhealthyInstances\":false,\"rollbackFailedInstancesOnPolicyBreach\":true}") + .toObject(RollingUpgradePolicy.class); + Assertions.assertEquals(true, model.enableCrossZoneUpgrade()); + Assertions.assertEquals(332964812, model.maxBatchInstancePercent()); + Assertions.assertEquals(969914681, model.maxUnhealthyInstancePercent()); + Assertions.assertEquals(1059529277, model.maxUnhealthyUpgradedInstancePercent()); + Assertions.assertEquals("zpof", model.pauseTimeBetweenBatches()); + Assertions.assertEquals(false, model.prioritizeUnhealthyInstances()); + Assertions.assertEquals(true, model.rollbackFailedInstancesOnPolicyBreach()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RollingUpgradePolicy model = new RollingUpgradePolicy().withEnableCrossZoneUpgrade(true) + .withMaxBatchInstancePercent(332964812).withMaxUnhealthyInstancePercent(969914681) + .withMaxUnhealthyUpgradedInstancePercent(1059529277).withPauseTimeBetweenBatches("zpof") + .withPrioritizeUnhealthyInstances(false).withRollbackFailedInstancesOnPolicyBreach(true); + model = BinaryData.fromObject(model).toObject(RollingUpgradePolicy.class); + Assertions.assertEquals(true, model.enableCrossZoneUpgrade()); + Assertions.assertEquals(332964812, model.maxBatchInstancePercent()); + Assertions.assertEquals(969914681, model.maxUnhealthyInstancePercent()); + Assertions.assertEquals(1059529277, model.maxUnhealthyUpgradedInstancePercent()); + Assertions.assertEquals("zpof", model.pauseTimeBetweenBatches()); + Assertions.assertEquals(false, model.prioritizeUnhealthyInstances()); + Assertions.assertEquals(true, model.rollbackFailedInstancesOnPolicyBreach()); + } +} diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/SkuCapabilityTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/SkuCapabilityTests.java index 224265044527e..dba08f6cb0379 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/SkuCapabilityTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/SkuCapabilityTests.java @@ -11,7 +11,7 @@ public final class SkuCapabilityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SkuCapability model - = BinaryData.fromString("{\"name\":\"pgvdf\",\"value\":\"otkftutqxlngx\"}").toObject(SkuCapability.class); + = BinaryData.fromString("{\"name\":\"ndrvynhzg\",\"value\":\"hrc\"}").toObject(SkuCapability.class); } @org.junit.jupiter.api.Test diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/SupportedSkuInnerTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/SupportedSkuInnerTests.java index 71036049aab27..a0258e638e234 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/SupportedSkuInnerTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/SupportedSkuInnerTests.java @@ -11,7 +11,7 @@ public final class SupportedSkuInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SupportedSkuInner model = BinaryData.fromString( - "{\"name\":\"uhrhcffcyddgl\",\"familyName\":\"t\",\"capabilities\":[{\"name\":\"wpyeicxmqciwqvh\",\"value\":\"ixuigdtopbobj\"},{\"name\":\"hm\",\"value\":\"u\"},{\"name\":\"a\",\"value\":\"rzayv\"}]}") + "{\"name\":\"w\",\"familyName\":\"m\",\"capabilities\":[{\"name\":\"z\",\"value\":\"vvtpgvdfgio\"},{\"name\":\"ftutqxlngxlefgu\",\"value\":\"xkrxdqmi\"},{\"name\":\"thz\",\"value\":\"qdrabhjybigehoqf\"},{\"name\":\"wska\",\"value\":\"ktzlcuiywg\"}],\"batchSupportEndOfLife\":\"2021-06-17T20:14:54Z\"}") .toObject(SupportedSkuInner.class); } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/SupportedSkusResultTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/SupportedSkusResultTests.java index 6aad0713b4623..89488781a8b51 100644 --- a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/SupportedSkusResultTests.java +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/SupportedSkusResultTests.java @@ -13,7 +13,7 @@ public final class SupportedSkusResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SupportedSkusResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"urzafb\",\"familyName\":\"j\",\"capabilities\":[{\"name\":\"oq\",\"value\":\"mkljavb\"},{\"name\":\"dtqajzyulpkudj\",\"value\":\"lkhbz\"},{\"name\":\"epgzgqexz\",\"value\":\"c\"},{\"name\":\"c\",\"value\":\"ierhhbcsglummaj\"}]},{\"name\":\"aodxo\",\"familyName\":\"bdxkqpxokaj\",\"capabilities\":[{\"name\":\"imexgstxgcpodgma\",\"value\":\"r\"},{\"name\":\"djwzrlov\",\"value\":\"lwhijcoejctbzaq\"}]},{\"name\":\"sycbkbfk\",\"familyName\":\"kdkexxp\",\"capabilities\":[{\"name\":\"xaxcfjpgddtocjjx\",\"value\":\"pmouexhdz\"}]},{\"name\":\"bqe\",\"familyName\":\"nxqbzvddn\",\"capabilities\":[{\"name\":\"eic\",\"value\":\"w\"}]}],\"nextLink\":\"zao\"}") + "{\"value\":[{\"name\":\"urzafb\",\"familyName\":\"j\",\"capabilities\":[{\"name\":\"oq\",\"value\":\"mkljavb\"},{\"name\":\"dtqajzyulpkudj\",\"value\":\"lkhbz\"},{\"name\":\"epgzgqexz\",\"value\":\"c\"},{\"name\":\"c\",\"value\":\"ierhhbcsglummaj\"}],\"batchSupportEndOfLife\":\"2021-08-25T02:16:19Z\"},{\"name\":\"dxob\",\"familyName\":\"dxkqpx\",\"capabilities\":[{\"name\":\"ionpimexg\",\"value\":\"xgcp\"},{\"name\":\"gmaajrm\",\"value\":\"jwzrl\"},{\"name\":\"mcl\",\"value\":\"ijcoejctb\"},{\"name\":\"qsqsy\",\"value\":\"kbfkg\"}],\"batchSupportEndOfLife\":\"2021-04-20T10:26:18Z\"},{\"name\":\"exxppofmxaxcfjp\",\"familyName\":\"dtocj\",\"capabilities\":[{\"name\":\"pmouexhdz\",\"value\":\"bqe\"},{\"name\":\"nxqbzvddn\",\"value\":\"ndei\"}],\"batchSupportEndOfLife\":\"2021-07-03T11:10:37Z\"},{\"name\":\"npzaoq\",\"familyName\":\"hrhcffcyddglmjth\",\"capabilities\":[{\"name\":\"pyeicxm\",\"value\":\"iwqvhkh\"}],\"batchSupportEndOfLife\":\"2021-04-08T23:48:15Z\"}],\"nextLink\":\"gdtopbobjogh\"}") .toObject(SupportedSkusResult.class); } diff --git a/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/UpgradePolicyTests.java b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/UpgradePolicyTests.java new file mode 100644 index 0000000000000..c80836a4bfec3 --- /dev/null +++ b/sdk/batch/azure-resourcemanager-batch/src/test/java/com/azure/resourcemanager/batch/generated/UpgradePolicyTests.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.batch.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.batch.models.AutomaticOSUpgradePolicy; +import com.azure.resourcemanager.batch.models.RollingUpgradePolicy; +import com.azure.resourcemanager.batch.models.UpgradeMode; +import com.azure.resourcemanager.batch.models.UpgradePolicy; +import org.junit.jupiter.api.Assertions; + +public final class UpgradePolicyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + UpgradePolicy model = BinaryData.fromString( + "{\"mode\":\"manual\",\"automaticOSUpgradePolicy\":{\"disableAutomaticRollback\":false,\"enableAutomaticOSUpgrade\":false,\"useRollingUpgradePolicy\":true,\"osRollingUpgradeDeferral\":true},\"rollingUpgradePolicy\":{\"enableCrossZoneUpgrade\":true,\"maxBatchInstancePercent\":881779477,\"maxUnhealthyInstancePercent\":1460158080,\"maxUnhealthyUpgradedInstancePercent\":1973822753,\"pauseTimeBetweenBatches\":\"kjj\",\"prioritizeUnhealthyInstances\":true,\"rollbackFailedInstancesOnPolicyBreach\":true}}") + .toObject(UpgradePolicy.class); + Assertions.assertEquals(UpgradeMode.MANUAL, model.mode()); + Assertions.assertEquals(false, model.automaticOSUpgradePolicy().disableAutomaticRollback()); + Assertions.assertEquals(false, model.automaticOSUpgradePolicy().enableAutomaticOSUpgrade()); + Assertions.assertEquals(true, model.automaticOSUpgradePolicy().useRollingUpgradePolicy()); + Assertions.assertEquals(true, model.automaticOSUpgradePolicy().osRollingUpgradeDeferral()); + Assertions.assertEquals(true, model.rollingUpgradePolicy().enableCrossZoneUpgrade()); + Assertions.assertEquals(881779477, model.rollingUpgradePolicy().maxBatchInstancePercent()); + Assertions.assertEquals(1460158080, model.rollingUpgradePolicy().maxUnhealthyInstancePercent()); + Assertions.assertEquals(1973822753, model.rollingUpgradePolicy().maxUnhealthyUpgradedInstancePercent()); + Assertions.assertEquals("kjj", model.rollingUpgradePolicy().pauseTimeBetweenBatches()); + Assertions.assertEquals(true, model.rollingUpgradePolicy().prioritizeUnhealthyInstances()); + Assertions.assertEquals(true, model.rollingUpgradePolicy().rollbackFailedInstancesOnPolicyBreach()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + UpgradePolicy model + = new UpgradePolicy().withMode(UpgradeMode.MANUAL) + .withAutomaticOSUpgradePolicy(new AutomaticOSUpgradePolicy().withDisableAutomaticRollback(false) + .withEnableAutomaticOSUpgrade(false).withUseRollingUpgradePolicy(true) + .withOsRollingUpgradeDeferral(true)) + .withRollingUpgradePolicy(new RollingUpgradePolicy().withEnableCrossZoneUpgrade(true) + .withMaxBatchInstancePercent(881779477).withMaxUnhealthyInstancePercent(1460158080) + .withMaxUnhealthyUpgradedInstancePercent(1973822753).withPauseTimeBetweenBatches("kjj") + .withPrioritizeUnhealthyInstances(true).withRollbackFailedInstancesOnPolicyBreach(true)); + model = BinaryData.fromObject(model).toObject(UpgradePolicy.class); + Assertions.assertEquals(UpgradeMode.MANUAL, model.mode()); + Assertions.assertEquals(false, model.automaticOSUpgradePolicy().disableAutomaticRollback()); + Assertions.assertEquals(false, model.automaticOSUpgradePolicy().enableAutomaticOSUpgrade()); + Assertions.assertEquals(true, model.automaticOSUpgradePolicy().useRollingUpgradePolicy()); + Assertions.assertEquals(true, model.automaticOSUpgradePolicy().osRollingUpgradeDeferral()); + Assertions.assertEquals(true, model.rollingUpgradePolicy().enableCrossZoneUpgrade()); + Assertions.assertEquals(881779477, model.rollingUpgradePolicy().maxBatchInstancePercent()); + Assertions.assertEquals(1460158080, model.rollingUpgradePolicy().maxUnhealthyInstancePercent()); + Assertions.assertEquals(1973822753, model.rollingUpgradePolicy().maxUnhealthyUpgradedInstancePercent()); + Assertions.assertEquals("kjj", model.rollingUpgradePolicy().pauseTimeBetweenBatches()); + Assertions.assertEquals(true, model.rollingUpgradePolicy().prioritizeUnhealthyInstances()); + Assertions.assertEquals(true, model.rollingUpgradePolicy().rollbackFailedInstancesOnPolicyBreach()); + } +} diff --git a/sdk/boms/azure-sdk-bom/pom.xml b/sdk/boms/azure-sdk-bom/pom.xml index 04dde96cf0467..4ccc16ebb201f 100644 --- a/sdk/boms/azure-sdk-bom/pom.xml +++ b/sdk/boms/azure-sdk-bom/pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.azure azure-sdk-bom - 1.2.21 + 1.2.22 pom Azure Java SDK BOM (Bill of Materials) Azure Java SDK BOM (Bill of Materials) diff --git a/sdk/boms/spring-cloud-azure-dependencies/pom.xml b/sdk/boms/spring-cloud-azure-dependencies/pom.xml index a92707f2a6cd1..5ffab135c5c3b 100644 --- a/sdk/boms/spring-cloud-azure-dependencies/pom.xml +++ b/sdk/boms/spring-cloud-azure-dependencies/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-dependencies - 4.17.0-beta.1 + 4.18.0-beta.1 pom Spring Cloud Azure Dependencies @@ -51,14 +51,14 @@ com.azure azure-sdk-bom - 1.2.21 + 1.2.22 pom import com.azure azure-spring-data-cosmos - 3.44.0-beta.1 + 3.45.0-beta.1 com.azure.resourcemanager diff --git a/sdk/communication/azure-communication-callautomation/pom.xml b/sdk/communication/azure-communication-callautomation/pom.xml index 83e5ffa4c8509..7aba66141fc62 100644 --- a/sdk/communication/azure-communication-callautomation/pom.xml +++ b/sdk/communication/azure-communication-callautomation/pom.xml @@ -122,6 +122,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-identity @@ -179,4 +185,21 @@ + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/communication/azure-communication-callingserver/pom.xml b/sdk/communication/azure-communication-callingserver/pom.xml index 2c25935c88baf..e774e7ddcbc1f 100644 --- a/sdk/communication/azure-communication-callingserver/pom.xml +++ b/sdk/communication/azure-communication-callingserver/pom.xml @@ -135,6 +135,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-identity @@ -186,4 +192,21 @@ + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/communication/azure-communication-chat/pom.xml b/sdk/communication/azure-communication-chat/pom.xml index ac30c723665d8..4f4fe4e369b3e 100644 --- a/sdk/communication/azure-communication-chat/pom.xml +++ b/sdk/communication/azure-communication-chat/pom.xml @@ -99,6 +99,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + @@ -138,4 +144,21 @@ + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/communication/azure-communication-email/pom.xml b/sdk/communication/azure-communication-email/pom.xml index 2ef1796d32882..ae1a1805e4143 100644 --- a/sdk/communication/azure-communication-email/pom.xml +++ b/sdk/communication/azure-communication-email/pom.xml @@ -99,6 +99,12 @@ 1.11.19 test
+ + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + @@ -137,4 +143,21 @@ + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/communication/azure-communication-identity/pom.xml b/sdk/communication/azure-communication-identity/pom.xml index d606a2c640ab9..b70969eca2010 100644 --- a/sdk/communication/azure-communication-identity/pom.xml +++ b/sdk/communication/azure-communication-identity/pom.xml @@ -112,6 +112,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-identity @@ -152,4 +158,21 @@ + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/communication/azure-communication-jobrouter/pom.xml b/sdk/communication/azure-communication-jobrouter/pom.xml index 7cb1654e6c257..5e11803fd9157 100644 --- a/sdk/communication/azure-communication-jobrouter/pom.xml +++ b/sdk/communication/azure-communication-jobrouter/pom.xml @@ -100,6 +100,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + org.slf4j slf4j-simple @@ -145,4 +151,21 @@ + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/communication/azure-communication-messages/pom.xml b/sdk/communication/azure-communication-messages/pom.xml index 9b4bfaaf56892..cc88fd7f9d4c6 100644 --- a/sdk/communication/azure-communication-messages/pom.xml +++ b/sdk/communication/azure-communication-messages/pom.xml @@ -111,6 +111,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + @@ -149,4 +155,21 @@ + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/communication/azure-communication-networktraversal/pom.xml b/sdk/communication/azure-communication-networktraversal/pom.xml index 5ab12c911f69e..c2f7d023b6d9b 100644 --- a/sdk/communication/azure-communication-networktraversal/pom.xml +++ b/sdk/communication/azure-communication-networktraversal/pom.xml @@ -104,6 +104,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-identity @@ -156,4 +162,21 @@ + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/communication/azure-communication-phonenumbers/pom.xml b/sdk/communication/azure-communication-phonenumbers/pom.xml index cbf7389c435ff..70e85bed5de3c 100644 --- a/sdk/communication/azure-communication-phonenumbers/pom.xml +++ b/sdk/communication/azure-communication-phonenumbers/pom.xml @@ -132,6 +132,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-identity @@ -186,4 +192,21 @@ + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/communication/azure-communication-rooms/pom.xml b/sdk/communication/azure-communication-rooms/pom.xml index b5aa9eb2594bf..cea39140f4176 100644 --- a/sdk/communication/azure-communication-rooms/pom.xml +++ b/sdk/communication/azure-communication-rooms/pom.xml @@ -107,7 +107,13 @@ azure-core-http-okhttp 1.11.19 test - + + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-identity @@ -115,4 +121,20 @@ test + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/communication/azure-communication-sms/pom.xml b/sdk/communication/azure-communication-sms/pom.xml index 8b40e8ec69513..c4682e935f98c 100644 --- a/sdk/communication/azure-communication-sms/pom.xml +++ b/sdk/communication/azure-communication-sms/pom.xml @@ -104,6 +104,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-identity @@ -143,4 +149,20 @@ + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md b/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md index 1f029f24c773f..da3ba92a0dddc 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md +++ b/sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md @@ -8,6 +8,8 @@ ### Bugs Fixed +- Fixed unreliable HTTP span reporting when response is not closed. + ### Other Changes ## 1.0.0-beta.44 (2024-03-01) diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/main/java/com/azure/core/tracing/opentelemetry/OpenTelemetryTracer.java b/sdk/core/azure-core-tracing-opentelemetry/src/main/java/com/azure/core/tracing/opentelemetry/OpenTelemetryTracer.java index 6b29677b51686..1a0389024a3cf 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/main/java/com/azure/core/tracing/opentelemetry/OpenTelemetryTracer.java +++ b/sdk/core/azure-core-tracing-opentelemetry/src/main/java/com/azure/core/tracing/opentelemetry/OpenTelemetryTracer.java @@ -102,7 +102,7 @@ public Context start(String spanName, StartSpanOptions options, Context context) return startSuppressedSpan(context); } context = unsuppress(context); - if (spanKind == SpanKind.INTERNAL && !context.getData(CLIENT_METHOD_CALL_FLAG).isPresent()) { + if (isInternalOrClientSpan(spanKind) && !context.getData(CLIENT_METHOD_CALL_FLAG).isPresent()) { context = context.addData(CLIENT_METHOD_CALL_FLAG, true); } @@ -184,6 +184,9 @@ private SpanBuilder createSpanBuilder(String spanName, StartSpanOptions options, return spanBuilder; } + /** + * {@inheritDoc} + */ @Override public void injectContext(BiConsumer headerSetter, Context context) { io.opentelemetry.context.Context otelContext = getTraceContextOrDefault(context, null); @@ -192,6 +195,9 @@ public void injectContext(BiConsumer headerSetter, Context conte } } + /** + * {@inheritDoc} + */ @Override public void setAttribute(String key, long value, Context context) { Objects.requireNonNull(context, "'context' cannot be null"); @@ -235,6 +241,28 @@ public void setAttribute(String key, String value, Context context) { } } + /** + * {@inheritDoc} + */ + @Override + public void setAttribute(String key, Object value, Context context) { + Objects.requireNonNull(value, "'value' cannot be null"); + Objects.requireNonNull(context, "'context' cannot be null"); + + if (!isEnabled) { + return; + } + + final Span span = getSpanOrNull(context); + if (span == null) { + return; + } + + if (span.isRecording()) { + OpenTelemetryUtils.addAttribute(span, key, value); + } + } + /** * {@inheritDoc} */ @@ -267,6 +295,24 @@ public Context extractContext(Function headerGetter) { return new Context(SPAN_CONTEXT_KEY, Span.fromContext(traceContext).getSpanContext()); } + /** + * {@inheritDoc} + */ + @Override + public boolean isRecording(Context context) { + Objects.requireNonNull(context, "'context' cannot be null"); + if (!isEnabled) { + return false; + } + + Span span = getSpanOrNull(context); + if (span != null) { + return span.isRecording(); + } + + return false; + } + private static class Getter implements TextMapGetter> { public static final TextMapGetter> INSTANCE = new Getter(); @@ -420,4 +466,8 @@ private static TracerProvider getTracerProvider(TracingOptions options) { return GlobalOpenTelemetry.getTracerProvider(); } + + private static boolean isInternalOrClientSpan(SpanKind kind) { + return kind == SpanKind.INTERNAL || kind == SpanKind.CLIENT; + } } diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/test/java/com/azure/core/tracing/opentelemetry/OpenTelemetryHttpPolicyTests.java b/sdk/core/azure-core-tracing-opentelemetry/src/test/java/com/azure/core/tracing/opentelemetry/OpenTelemetryHttpPolicyTests.java index c452de4d6387c..9b5fc6309144a 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/test/java/com/azure/core/tracing/opentelemetry/OpenTelemetryHttpPolicyTests.java +++ b/sdk/core/azure-core-tracing-opentelemetry/src/test/java/com/azure/core/tracing/opentelemetry/OpenTelemetryHttpPolicyTests.java @@ -112,7 +112,7 @@ public void openTelemetryHttpPolicyTest() { request.setHeader(HttpHeaderName.USER_AGENT, "user-agent"); try (Scope scope = parentSpan.makeCurrent()) { - createHttpPipeline(azTracer).send(request, tracingContext).block().close(); + createHttpPipeline(azTracer).send(request, tracingContext).block().getBodyAsBinaryData(); } // Assert List exportedSpans = exporter.getFinishedSpanItems(); @@ -181,8 +181,9 @@ public String getDescription() { public void clientRequestIdIsStamped() { try (Scope scope = tracer.spanBuilder("test").startSpan().makeCurrent()) { HttpRequest request = new HttpRequest(HttpMethod.PUT, "https://httpbin.org/hello?there#otel"); - HttpResponse response = createHttpPipeline(azTracer, new RequestIdPolicy()).send(request).block(); - response.close(); + HttpResponse response = createHttpPipeline(azTracer, new RequestIdPolicy()).send(request) + .flatMap(r -> r.getBodyAsByteArray().thenReturn(r)) + .block(); // Assert List exportedSpans = exporter.getFinishedSpanItems(); @@ -293,8 +294,8 @@ public void endStatusDependingOnStatusCode(int statusCode, StatusCode status) { StepVerifier.create(pipeline.send(new HttpRequest(HttpMethod.GET, "http://localhost/hello"))) .assertNext(response -> { + response.getBodyAsByteArray().block(); assertEquals(statusCode, response.getStatusCode()); - response.close(); }) .verifyComplete(); @@ -366,12 +367,10 @@ public void timeoutIsTraced() { = new Context(PARENT_TRACE_CONTEXT_KEY, io.opentelemetry.context.Context.root().with(parentSpan)) .addData("az.namespace", "foo"); - StepVerifier.create(pipeline.send(new HttpRequest(HttpMethod.GET, "http://localhost/hello"), tracingContext)) - .assertNext(response -> { + StepVerifier.create(pipeline.send(new HttpRequest(HttpMethod.GET, "http://localhost/hello"), tracingContext) + .flatMap(r -> r.getBody().collectList().thenReturn(r))).assertNext(response -> { assertEquals(200, response.getStatusCode()); - response.close(); - }) - .verifyComplete(); + }).verifyComplete(); List exportedSpans = exporter.getFinishedSpanItems(); assertEquals(2, exportedSpans.size()); @@ -398,11 +397,8 @@ public void connectionErrorAfterResponseCodeIsTraced() { .tracer(azTracer) .build(); - StepVerifier - .create(pipeline.send(new HttpRequest(HttpMethod.GET, "http://localhost/hello"), Context.NONE) - .flatMap(response -> response.getBodyAsInputStream().doFinally(i -> response.close()))) - .expectError(IOException.class) - .verify(); + StepVerifier.create(pipeline.send(new HttpRequest(HttpMethod.GET, "http://localhost/hello"), Context.NONE) + .flatMap(response -> response.getBodyAsInputStream())).expectError(IOException.class).verify(); List exportedSpans = exporter.getFinishedSpanItems(); assertEquals(1, exportedSpans.size()); diff --git a/sdk/core/azure-core-tracing-opentelemetry/src/test/java/com/azure/core/tracing/opentelemetry/OpenTelemetryTracerTest.java b/sdk/core/azure-core-tracing-opentelemetry/src/test/java/com/azure/core/tracing/opentelemetry/OpenTelemetryTracerTest.java index c2f5c76ae12c8..63663e2f04368 100644 --- a/sdk/core/azure-core-tracing-opentelemetry/src/test/java/com/azure/core/tracing/opentelemetry/OpenTelemetryTracerTest.java +++ b/sdk/core/azure-core-tracing-opentelemetry/src/test/java/com/azure/core/tracing/opentelemetry/OpenTelemetryTracerTest.java @@ -36,6 +36,7 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.params.provider.ValueSource; import reactor.core.Exceptions; import java.io.IOException; @@ -285,6 +286,28 @@ public void startWithRemoteParent() { assertEquals(SpanKind.CONSUMER, spanData.getKind()); } + @ParameterizedTest + @ValueSource(booleans = { true, false }) + public void testIsRecording(boolean isRecording) { + // Arrange + SpanContext remoteParent + = SpanContext.create(IdGenerator.random().generateTraceId(), IdGenerator.random().generateSpanId(), + isRecording ? TraceFlags.getSampled() : TraceFlags.getDefault(), TraceState.getDefault()); + StartSpanOptions options = new StartSpanOptions(com.azure.core.util.tracing.SpanKind.CLIENT) + .setRemoteParent(new Context(SPAN_CONTEXT_KEY, remoteParent)); + + // Act + final Context span = openTelemetryTracer.start(METHOD_NAME, options, Context.NONE); + + // Assert + assertEquals(isRecording, openTelemetryTracer.isRecording(span)); + } + + @Test + public void testIsRecordingNoSpan() { + assertFalse(openTelemetryTracer.isRecording(Context.NONE)); + } + @Test @SuppressWarnings("deprecation") public void startSpanProcessKindSend() { @@ -462,7 +485,6 @@ public void startConsumeSpanWitStartTimeInContext() { @Test @SuppressWarnings("deprecation") public void startSpanOverloadNullPointerException() { - // Assert assertThrows(NullPointerException.class, () -> openTelemetryTracer.start("", Context.NONE, null)); } @@ -476,23 +498,19 @@ public void startSpanInvalid() { new StartSpanOptions(com.azure.core.util.tracing.SpanKind.CONSUMER), Context.NONE)); assertThrows(NullPointerException.class, () -> openTelemetryTracer.start("span", new StartSpanOptions(com.azure.core.util.tracing.SpanKind.CONSUMER), null)); - } @Test - @SuppressWarnings("deprecation") public void addLinkTest() { // Arrange - StartSpanOptions spanBuilder = new StartSpanOptions(com.azure.core.util.tracing.SpanKind.INTERNAL); Span toLinkSpan = tracer.spanBuilder("new test span").startSpan(); - Context linkContext = new Context(SPAN_CONTEXT_KEY, toLinkSpan.getSpanContext()); LinkData expectedLink = LinkData.create(toLinkSpan.getSpanContext()); + StartSpanOptions startOptions + = new StartSpanOptions(com.azure.core.util.tracing.SpanKind.INTERNAL).addLink(new TracingLink(linkContext)); // Act - openTelemetryTracer.addLink(linkContext.addData(SPAN_BUILDER_KEY, spanBuilder)); - - Context span = openTelemetryTracer.start(METHOD_NAME, spanBuilder, Context.NONE); + Context span = openTelemetryTracer.start(METHOD_NAME, startOptions, Context.NONE); ReadableSpan span1 = getSpan(span); // Assert @@ -886,6 +904,36 @@ public void startSpanWithAttributes() { verifySpanAttributes(expectedAttributes, span.toSpanData().getAttributes()); } + @Test + public void spanAttributes() { + Map attributes = new HashMap<>(); + attributes.put("S", "foo"); + attributes.put("I", 1); + attributes.put("L", 10L); + attributes.put("D", 0.1d); + attributes.put("B", true); + attributes.put("S[]", new String[] { "foo" }); + attributes.put("L[]", new long[] { 10L }); + attributes.put("D[]", new double[] { 0.1d }); + attributes.put("B[]", new boolean[] { true }); + attributes.put("I[]", new int[] { 1 }); + attributes.put("Complex", Collections.singletonMap("key", "value")); + + Attributes expectedAttributes = Attributes.builder() + .put("S", "foo") + .put("L", 10L) + .put("I", 1) + .put("D", 0.1d) + .put("B", true) + .put("az.namespace", AZ_NAMESPACE_VALUE) + .build(); + + Context spanCtx = openTelemetryTracer.start(METHOD_NAME, tracingContext); + attributes.forEach((key, value) -> openTelemetryTracer.setAttribute(key, value, spanCtx)); + final ReadableSpan span = getSpan(spanCtx); + verifySpanAttributes(expectedAttributes, span.toSpanData().getAttributes()); + } + @Test public void suppressNestedClientSpan() { Context outer = openTelemetryTracer.start("outer", Context.NONE); @@ -909,9 +957,9 @@ public void suppressNestedClientSpan() { } @Test - @SuppressWarnings("deprecation") public void suppressNestedInterleavedClientSpan() { - Context outer = openTelemetryTracer.start("outer", Context.NONE, com.azure.core.util.tracing.ProcessKind.SEND); + Context outer = openTelemetryTracer.start("outer", + new StartSpanOptions(com.azure.core.util.tracing.SpanKind.CONSUMER), Context.NONE); Context inner1NotSuppressed = openTelemetryTracer.start("innerSuppressed", outer); Context inner2Suppressed = openTelemetryTracer.start("innerSuppressed", inner1NotSuppressed); @@ -940,7 +988,7 @@ public void suppressNestedInterleavedClientSpanWithOptions() { Context inner1Suppressed = openTelemetryTracer.start("innerSuppressed", outer); Context inner1NotSuppressed = openTelemetryTracer.start("innerNotSuppressed", - new StartSpanOptions(com.azure.core.util.tracing.SpanKind.CLIENT), inner1Suppressed); + new StartSpanOptions(com.azure.core.util.tracing.SpanKind.PRODUCER), inner1Suppressed); Context inner2Suppressed = openTelemetryTracer.start("innerSuppressed", inner1NotSuppressed); openTelemetryTracer.end("ok", null, inner2Suppressed); @@ -1009,7 +1057,7 @@ public static Stream spanKinds() { Arguments.of(com.azure.core.util.tracing.SpanKind.CLIENT, com.azure.core.util.tracing.SpanKind.CLIENT, false), Arguments.of(com.azure.core.util.tracing.SpanKind.CLIENT, com.azure.core.util.tracing.SpanKind.INTERNAL, - false), + true), Arguments.of(com.azure.core.util.tracing.SpanKind.CLIENT, com.azure.core.util.tracing.SpanKind.PRODUCER, false), Arguments.of(com.azure.core.util.tracing.SpanKind.CLIENT, com.azure.core.util.tracing.SpanKind.CONSUMER, diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index 7b8546e9b8cae..246794c098fae 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -4,6 +4,8 @@ ### Features Added +- Added new methods on `com.azure.core.util.tracing.Tracer` - `isRecording` and `addAttribute(String, Object, Context)`. + ### Breaking Changes ### Bugs Fixed diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/policy/InstrumentationPolicy.java b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/policy/InstrumentationPolicy.java index 9a3b22760d2e7..3dc2f4e665b87 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/policy/InstrumentationPolicy.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/policy/InstrumentationPolicy.java @@ -25,6 +25,7 @@ import java.net.URL; import java.nio.ByteBuffer; import java.nio.charset.Charset; +import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; import static com.azure.core.http.HttpHeaderName.X_MS_CLIENT_REQUEST_ID; import static com.azure.core.http.HttpHeaderName.X_MS_REQUEST_ID; @@ -54,6 +55,8 @@ public class InstrumentationPolicy implements HttpPipelinePolicy { private static final String SERVER_PORT = "server.port"; private static final ClientLogger LOGGER = new ClientLogger(InstrumentationPolicy.class); + // magic OpenTelemetry string that represents unknown error. + private static final String OTHER_ERROR_TYPE = "_OTHER"; private Tracer tracer; /** @@ -82,7 +85,7 @@ public Mono process(HttpPipelineCallContext context, HttpPipelineN return next.process() .doOnSuccess(response -> onResponseCode(response, span)) // TODO: maybe we can optimize it? https://github.com/Azure/azure-sdk-for-java/issues/38228 - .map(response -> new TraceableResponse(response, span)) + .map(response -> TraceableResponse.create(response, tracer, span)) .doOnCancel(() -> tracer.end(CANCELLED_ERROR_TYPE, null, span)) .doOnError(exception -> tracer.end(null, exception, span)); }); @@ -100,7 +103,7 @@ public HttpResponse processSync(HttpPipelineCallContext context, HttpPipelineNex HttpResponse response = next.processSync(); onResponseCode(response, span); // TODO: maybe we can optimize it? https://github.com/Azure/azure-sdk-for-java/issues/38228 - return new TraceableResponse(response, span); + return TraceableResponse.create(response, tracer, span); } catch (RuntimeException ex) { tracer.end(null, ex, span); throw ex; @@ -150,7 +153,7 @@ private void addPostSamplingAttributes(Context span, HttpRequest request) { } private void onResponseCode(HttpResponse response, Context span) { - if (response != null) { + if (response != null && tracer.isRecording(span)) { int statusCode = response.getStatusCode(); tracer.setAttribute(HTTP_STATUS_CODE, statusCode, span); String requestId = response.getHeaderValue(X_MS_REQUEST_ID); @@ -164,16 +167,29 @@ private boolean isTracingEnabled(HttpPipelineCallContext context) { return tracer != null && tracer.isEnabled() && !((boolean) context.getData(DISABLE_TRACING_KEY).orElse(false)); } - private final class TraceableResponse extends HttpResponse { + private static final class TraceableResponse extends HttpResponse { private final HttpResponse response; private final Context span; - private Throwable exception; - private String errorType; + private final Tracer tracer; + private volatile int ended = 0; + private static final AtomicIntegerFieldUpdater ENDED_UPDATER + = AtomicIntegerFieldUpdater.newUpdater(TraceableResponse.class, "ended"); - TraceableResponse(HttpResponse response, Context span) { + private TraceableResponse(HttpResponse response, Tracer tracer, Context span) { super(response.getRequest()); this.response = response; this.span = span; + this.tracer = tracer; + } + + public static HttpResponse create(HttpResponse response, Tracer tracer, Context span) { + if (tracer.isRecording(span)) { + return new TraceableResponse(response, tracer, span); + } + + // OTel does not need to end sampled-out spans, but let's do it just in case + tracer.end(null, null, span); + return response; } @Override @@ -199,21 +215,21 @@ public HttpHeaders getHeaders() { @Override public Flux getBody() { - return response.getBody().doOnError(e -> exception = e).doOnCancel(() -> errorType = CANCELLED_ERROR_TYPE); + return Flux.using(() -> span, + s -> response.getBody() + .doOnError(e -> onError(null, e)) + .doOnCancel(() -> onError(CANCELLED_ERROR_TYPE, null)), + s -> endNoError()); } @Override public Mono getBodyAsByteArray() { - return response.getBodyAsByteArray() - .doOnError(e -> exception = e) - .doOnCancel(() -> errorType = CANCELLED_ERROR_TYPE); + return endSpanWhen(response.getBodyAsByteArray()); } @Override public Mono getBodyAsString() { - return response.getBodyAsString() - .doOnError(e -> exception = e) - .doOnCancel(() -> errorType = CANCELLED_ERROR_TYPE); + return endSpanWhen(response.getBodyAsString()); } @Override @@ -221,34 +237,52 @@ public BinaryData getBodyAsBinaryData() { try { return response.getBodyAsBinaryData(); } catch (Exception e) { - exception = e; + onError(null, e); throw e; + } finally { + endNoError(); } } @Override public Mono getBodyAsString(Charset charset) { - return response.getBodyAsString(charset) - .doOnError(e -> exception = e) - .doOnCancel(() -> errorType = CANCELLED_ERROR_TYPE); + return endSpanWhen(response.getBodyAsString(charset)); } @Override public Mono getBodyAsInputStream() { - return response.getBodyAsInputStream() - .doOnError(e -> exception = e) - .doOnCancel(() -> errorType = CANCELLED_ERROR_TYPE); + return endSpanWhen(response.getBodyAsInputStream()); } @Override public void close() { response.close(); - int statusCode = response.getStatusCode(); + endNoError(); + } + + private Mono endSpanWhen(Mono publisher) { + return Mono.using(() -> span, + s -> publisher.doOnError(e -> onError(null, e)).doOnCancel(() -> onError(CANCELLED_ERROR_TYPE, null)), + s -> endNoError()); + } + + private void onError(String errorType, Throwable error) { + if (ENDED_UPDATER.compareAndSet(this, 0, 1)) { + tracer.end(errorType, error, span); + } + } + + private void endNoError() { + if (ENDED_UPDATER.compareAndSet(this, 0, 1)) { + String errorType = null; + if (response == null) { + errorType = OTHER_ERROR_TYPE; + } else if (response.getStatusCode() >= 400) { + errorType = String.valueOf(response.getStatusCode()); + } - if (errorType == null && statusCode >= 400) { - errorType = String.valueOf(statusCode); + tracer.end(errorType, null, span); } - tracer.end(errorType, exception, span); } } } diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/AsyncRestProxy.java b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/AsyncRestProxy.java index 37e7693d40b87..e45a5a7dec7be 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/AsyncRestProxy.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/AsyncRestProxy.java @@ -19,6 +19,7 @@ import com.azure.core.util.FluxUtil; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.core.util.tracing.Tracer; import com.azure.json.JsonSerializable; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -277,7 +278,7 @@ private Object handleRestReturnType(Mono tracer.end(CANCELLED_ERROR_TYPE, null, span)) - .contextWrite(reactor.util.context.Context.of("TRACING_CONTEXT", span)); + .contextWrite(reactor.util.context.Context.of(Tracer.PARENT_TRACE_CONTEXT_KEY, span)); } return getResponse; diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/RestProxyBase.java b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/RestProxyBase.java index 2314b0f46d269..1aa122f8b38b5 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/RestProxyBase.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/implementation/http/rest/RestProxyBase.java @@ -227,7 +227,7 @@ public Response createResponse(HttpResponseDecoder.HttpDecodedResponse response, */ Context startTracingSpan(SwaggerMethodParser method, Context context) { if (isTracingEnabled(context)) { - Object tracingContextObj = context.getData("TRACING_CONTEXT").orElse(null); + Object tracingContextObj = context.getData(Tracer.PARENT_TRACE_CONTEXT_KEY).orElse(null); Context tracingContext = tracingContextObj instanceof Context ? (Context) tracingContextObj : context; return tracer.start(method.getSpanName(), tracingContext); } diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/util/tracing/Tracer.java b/sdk/core/azure-core/src/main/java/com/azure/core/util/tracing/Tracer.java index 4409333255242..ea343c3a75278 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/util/tracing/Tracer.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/util/tracing/Tracer.java @@ -371,7 +371,6 @@ default void end(int responseCode, Throwable error, Context context) { * tracer.setAttribute("foo", 42, span); * * - * @param key attribute name * @param value atteribute value * @param context tracing context @@ -380,6 +379,28 @@ default void setAttribute(String key, long value, Context context) { setAttribute(key, Long.toString(value), context); } + /** + * Sets an attribute on span. + * Adding duplicate attributes, update, or removal is discouraged, since underlying implementations + * behavior can vary. + * + * @param key attribute key. + * @param value attribute value. Note that underlying tracer implementations limit supported value types. + * OpenTelemetry implementation supports following types: + *
    + *
  • {@link String}
  • + *
  • {@code int}
  • + *
  • {@code double}
  • + *
  • {@code boolean}
  • + *
  • {@code long}
  • + *
+ * @param context context containing span to which attribute is added. + */ + default void setAttribute(String key, Object value, Context context) { + Objects.requireNonNull(value, "'value' cannot be null."); + setAttribute(key, value.toString(), context); + } + /** * Sets the name for spans that are created. * @@ -620,6 +641,16 @@ default AutoCloseable makeSpanCurrent(Context context) { return NoopTracer.INSTANCE.makeSpanCurrent(context); } + /** + * Checks if span is sampled in. + * + * @param span Span to check. + * @return true if span is recording, false otherwise. + */ + default boolean isRecording(Context span) { + return true; + } + /** * Checks if tracer is enabled. * diff --git a/sdk/core/azure-core/src/main/java/module-info.java b/sdk/core/azure-core/src/main/java/module-info.java index 652f094e1f500..eae31b0a33997 100644 --- a/sdk/core/azure-core/src/main/java/module-info.java +++ b/sdk/core/azure-core/src/main/java/module-info.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. module com.azure.core { - requires com.azure.json; + requires transitive com.azure.json; requires transitive reactor.core; requires transitive org.reactivestreams; requires transitive org.slf4j; diff --git a/sdk/core/azure-core/src/test/java/com/azure/core/util/tracing/RestProxyTracingTests.java b/sdk/core/azure-core/src/test/java/com/azure/core/util/tracing/RestProxyTracingTests.java index 933deddbdc979..98f2faeb48f37 100644 --- a/sdk/core/azure-core/src/test/java/com/azure/core/util/tracing/RestProxyTracingTests.java +++ b/sdk/core/azure-core/src/test/java/com/azure/core/util/tracing/RestProxyTracingTests.java @@ -56,8 +56,8 @@ void beforeEach() { @SyncAsyncTest public void restProxySuccess() throws Exception { - SyncAsyncExtension.execute(() -> testInterface.testMethodReturnsMonoVoidSync(), - () -> testInterface.testMethodReturnsMonoVoid().block()); + SyncAsyncExtension.execute(() -> testInterface.testMethodReturnsMonoVoidSync(Context.NONE), + () -> testInterface.testMethodReturnsMonoVoid(Context.NONE).block()); assertEquals(2, tracer.getSpans().size()); Span restProxy = tracer.getSpans().get(0); @@ -69,9 +69,28 @@ public void restProxySuccess() throws Exception { assertNull(restProxy.getErrorMessage()); } + @SyncAsyncTest + public void restProxyNested() throws Exception { + Context outerSpan = tracer.start("outer", Context.NONE); + SyncAsyncExtension.execute(() -> testInterface.testMethodReturnsMonoVoidSync(outerSpan), + () -> testInterface.testMethodReturnsMonoVoid(outerSpan).block()); + tracer.end(null, null, outerSpan); + + assertEquals(3, tracer.getSpans().size()); + Span outer = tracer.getSpans().get(0); + Span restProxy = tracer.getSpans().get(1); + Span http = tracer.getSpans().get(2); + + assertEquals(getSpan(restProxy.getStartContext()), outer); + assertEquals(getSpan(http.getStartContext()), restProxy); + assertTrue(restProxy.getName().startsWith("myService.testMethodReturnsMonoVoid")); + assertNull(restProxy.getThrowable()); + assertNull(restProxy.getErrorMessage()); + } + @Test public void restProxyCancelAsync() { - testInterface.testMethodDelays().timeout(Duration.ofMillis(10)).toFuture().cancel(true); + StepVerifier.create(testInterface.testMethodDelays()).expectSubscription().thenCancel().verify(); assertEquals(2, tracer.getSpans().size()); Span restProxy = tracer.getSpans().get(0); @@ -235,11 +254,11 @@ public HttpResponse sendSync(HttpRequest request, Context context) { interface TestInterface { @Get("my/url/path") @ExpectedResponses({ 200 }) - Mono testMethodReturnsMonoVoid(); + Mono testMethodReturnsMonoVoid(Context context); @Get("my/url/path") @ExpectedResponses({ 200 }) - Response testMethodReturnsMonoVoidSync(); + Response testMethodReturnsMonoVoidSync(Context context); @Post("my/url/path") @ExpectedResponses({ 500 }) diff --git a/sdk/cosmos/azure-cosmos-benchmark/pom.xml b/sdk/cosmos/azure-cosmos-benchmark/pom.xml index b4c9da6dc97cd..e0c704b43599a 100644 --- a/sdk/cosmos/azure-cosmos-benchmark/pom.xml +++ b/sdk/cosmos/azure-cosmos-benchmark/pom.xml @@ -57,7 +57,7 @@ Licensed under the MIT License. com.azure azure-cosmos-encryption - 2.9.0 + 2.10.0-beta.1 diff --git a/sdk/cosmos/azure-cosmos-encryption/CHANGELOG.md b/sdk/cosmos/azure-cosmos-encryption/CHANGELOG.md index cac0209b00fad..763f39923c3aa 100644 --- a/sdk/cosmos/azure-cosmos-encryption/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos-encryption/CHANGELOG.md @@ -1,5 +1,15 @@ ## Release History +### 2.10.0-beta.1 (Unreleased) + +#### Features Added + +#### Breaking Changes + +#### Bugs Fixed + +#### Other Changes + ### 2.9.0 (2024-03-26) #### Other Changes * Updated `azure-cosmos` to version `4.57.0`. diff --git a/sdk/cosmos/azure-cosmos-encryption/pom.xml b/sdk/cosmos/azure-cosmos-encryption/pom.xml index ea1d311c501a5..0ceb980d9e13b 100644 --- a/sdk/cosmos/azure-cosmos-encryption/pom.xml +++ b/sdk/cosmos/azure-cosmos-encryption/pom.xml @@ -13,7 +13,7 @@ Licensed under the MIT License. com.azure azure-cosmos-encryption - 2.9.0 + 2.10.0-beta.1 Encryption Plugin for Azure Cosmos DB SDK This Package contains Encryption Plugin for Microsoft Azure Cosmos SDK jar @@ -57,7 +57,7 @@ Licensed under the MIT License. com.azure azure-cosmos - 4.57.0 + 4.58.0-beta.1 diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/CHANGELOG.md b/sdk/cosmos/azure-cosmos-kafka-connect/CHANGELOG.md index 532c376c58a94..489d2af49ea33 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos-kafka-connect/CHANGELOG.md @@ -3,7 +3,8 @@ ### 1.0.0-beta.1 (Unreleased) #### Features Added -* Added Source connector. See [PR 39410](https://github.com/Azure/azure-sdk-for-java/pull/39410) +* Added Source connector. See [PR 39410](https://github.com/Azure/azure-sdk-for-java/pull/39410) +* Added Sink connector. See [PR 39434](https://github.com/Azure/azure-sdk-for-java/pull/39434) #### Breaking Changes diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/doc/configuration-reference.md b/sdk/cosmos/azure-cosmos-kafka-connect/doc/configuration-reference.md index 8512ba8d7af79..064aaab81a76e 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/doc/configuration-reference.md +++ b/sdk/cosmos/azure-cosmos-kafka-connect/doc/configuration-reference.md @@ -23,3 +23,16 @@ | `kafka.connect.cosmos.source.metadata.storage.topic` | `_cosmos.metadata.topic` | The name of the topic where the metadata are stored. The metadata topic will be created if it does not already exist, else it will use the pre-created topic. | | `kafka.connect.cosmos.source.messageKey.enabled` | `true` | Whether to set the kafka record message key. | | `kafka.connect.cosmos.source.messageKey.field` | `id` | The field to use as the message key. | + +## Sink Connector Configuration +| Config Property Name | Default | Description | +|:---------------------------------------------------------------|:--------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `kafka.connect.cosmos.sink.database.name` | None | Cosmos DB database name. | +| `kafka.connect.cosmos.sink.containers.topicMap` | None | A comma delimited list of Kafka topics mapped to Cosmos containers. For example: topic1#con1,topic2#con2. | +| `kafka.connect.cosmos.sink.errors.tolerance` | `None` | Error tolerance level after exhausting all retries. `None` for fail on error. `All` for log and continue | +| `kafka.connect.cosmos.sink.bulk.enabled` | `true` | Flag to indicate whether Cosmos DB bulk mode is enabled for Sink connector. By default it is true. | +| `kafka.connect.cosmos.sink.bulk.maxConcurrentCosmosPartitions` | `-1` | Cosmos DB Item Write Max Concurrent Cosmos Partitions. If not specified it will be determined based on the number of the container's physical partitions which would indicate every batch is expected to have data from all Cosmos physical partitions. If specified it indicates from at most how many Cosmos Physical Partitions each batch contains data. So this config can be used to make bulk processing more efficient when input data in each batch has been repartitioned to balance to how many Cosmos partitions each batch needs to write. This is mainly useful for very large containers (with hundreds of physical partitions. | +| `kafka.connect.cosmos.sink.bulk.initialBatchSize` | `1` | Cosmos DB initial bulk micro batch size - a micro batch will be flushed to the backend when the number of documents enqueued exceeds this size - or the target payload size is met. The micro batch size is getting automatically tuned based on the throttling rate. By default the initial micro batch size is 1. Reduce this when you want to avoid that the first few requests consume too many RUs. | +| `kafka.connect.cosmos.sink.write.strategy` | `ItemOverwrite` | Cosmos DB Item write Strategy: `ItemOverwrite` (using upsert), `ItemAppend` (using create, ignore pre-existing items i.e., Conflicts), `ItemDelete` (deletes based on id/pk of data frame), `ItemDeleteIfNotModified` (deletes based on id/pk of data frame if etag hasn't changed since collecting id/pk), `ItemOverwriteIfNotModified` (using create if etag is empty, update/replace with etag pre-condition otherwise, if document was updated the pre-condition failure is ignored) | +| `kafka.connect.cosmos.sink.maxRetryCount` | `10` | Cosmos DB max retry attempts on write failures for Sink connector. By default, the connector will retry on transient write errors for up to 10 times. | +| `kafka.connect.cosmos.sink.id.strategy` | `ProvidedInValueStrategy` | A strategy used to populate the document with an ``id``. Valid strategies are: ``TemplateStrategy``, ``FullKeyStrategy``, ``KafkaMetadataStrategy``, ``ProvidedInKeyStrategy``, ``ProvidedInValueStrategy``. Configuration properties prefixed with``id.strategy`` are passed through to the strategy. For example, when using ``id.strategy=TemplateStrategy`` , the property ``id.strategy.template`` is passed through to the template strategy and used to specify the template string to be used in constructing the ``id``. | diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml b/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml index 76bdce066b676..09e1447d9d227 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml +++ b/sdk/cosmos/azure-cosmos-kafka-connect/pom.xml @@ -44,14 +44,17 @@ Licensed under the MIT License. true + --add-opens com.azure.cosmos/com.azure.cosmos.implementation=ALL-UNNAMED + --add-opens com.azure.cosmos/com.azure.cosmos.implementation.apachecommons.lang=ALL-UNNAMED + --add-opens com.azure.cosmos/com.azure.cosmos.implementation.caches=ALL-UNNAMED + --add-opens com.azure.cosmos/com.azure.cosmos.implementation.faultinjection=ALL-UNNAMED + --add-opens com.azure.cosmos/com.azure.cosmos.implementation.routing=ALL-UNNAMED --add-opens com.azure.cosmos.kafka.connect/com.azure.cosmos.kafka.connect=ALL-UNNAMED --add-opens com.azure.cosmos.kafka.connect/com.azure.cosmos.kafka.connect.implementation=ALL-UNNAMED + --add-opens com.azure.cosmos.kafka.connect/com.azure.cosmos.kafka.connect.implementation.sink=ALL-UNNAMED + --add-opens com.azure.cosmos.kafka.connect/com.azure.cosmos.kafka.connect.implementation.sink.idStrategy=ALL-UNNAMED --add-opens com.azure.cosmos.kafka.connect/com.azure.cosmos.kafka.connect.implementation.source=com.fasterxml.jackson.databind,ALL-UNNAMED - --add-opens com.azure.cosmos/com.azure.cosmos.implementation.routing=ALL-UNNAMED - --add-opens com.azure.cosmos/com.azure.cosmos.implementation.apachecommons.lang=ALL-UNNAMED - --add-exports com.azure.cosmos/com.azure.cosmos.implementation.changefeed.common=com.azure.cosmos.kafka.connect - --add-exports com.azure.cosmos/com.azure.cosmos.implementation.feedranges=com.azure.cosmos.kafka.connect - --add-exports com.azure.cosmos/com.azure.cosmos.implementation.query=com.azure.cosmos.kafka.connect + @@ -83,6 +86,13 @@ Licensed under the MIT License. provided + + com.azure + azure-cosmos-test + 1.0.0-beta.7 + test + + org.apache.commons commons-collections4 @@ -96,6 +106,24 @@ Licensed under the MIT License. test 1.10.0 + + com.jayway.jsonpath + json-path + 2.9.0 + + + + org.apache.kafka + connect-runtime + 3.6.0 + test + + + jackson-jaxrs-json-provider + com.fasterxml.jackson.jaxrs + + + org.apache.kafka @@ -238,6 +266,7 @@ Licensed under the MIT License. com.azure:* org.apache.kafka:connect-api:[3.6.0] io.confluent:kafka-connect-maven-plugin:[0.12.0] + com.jayway.jsonpath:json-path:[2.9.0] org.sourcelab:kafka-connect-client:[4.0.4] @@ -322,6 +351,10 @@ Licensed under the MIT License. reactor ${shadingPrefix}.reactor + + com.jayway.jsonpath + ${shadingPrefix}.com.jayway.jsonpath + @@ -459,7 +492,7 @@ Licensed under the MIT License. - kafka-integration + kafka kafka diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/CosmosSinkConnector.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/CosmosSinkConnector.java new file mode 100644 index 0000000000000..ef38399c74396 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/CosmosSinkConnector.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect; + +import com.azure.cosmos.kafka.connect.implementation.KafkaCosmosConstants; +import com.azure.cosmos.kafka.connect.implementation.sink.CosmosSinkConfig; +import com.azure.cosmos.kafka.connect.implementation.sink.CosmosSinkTask; +import org.apache.kafka.common.config.ConfigDef; +import org.apache.kafka.connect.connector.Task; +import org.apache.kafka.connect.sink.SinkConnector; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * A Sink connector that publishes topic messages to CosmosDB. + */ +public class CosmosSinkConnector extends SinkConnector { + private static final Logger LOGGER = LoggerFactory.getLogger(CosmosSinkConnector.class); + + private CosmosSinkConfig sinkConfig; + + @Override + public void start(Map props) { + LOGGER.info("Starting the kafka cosmos sink connector"); + this.sinkConfig = new CosmosSinkConfig(props); + } + + @Override + public Class taskClass() { + return CosmosSinkTask.class; + } + + @Override + public List> taskConfigs(int maxTasks) { + LOGGER.info("Setting task configurations with maxTasks {}", maxTasks); + List> configs = new ArrayList<>(); + for (int i = 0; i < maxTasks; i++) { + configs.add(this.sinkConfig.originalsStrings()); + } + + return configs; + } + + @Override + public void stop() { + LOGGER.info("Kafka Cosmos sink connector {} is stopped."); + } + + @Override + public ConfigDef config() { + return CosmosSinkConfig.getConfigDef(); + } + + @Override + public String version() { + return KafkaCosmosConstants.CURRENT_VERSION; + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/CosmosDBSourceConnector.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/CosmosSourceConnector.java similarity index 98% rename from sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/CosmosDBSourceConnector.java rename to sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/CosmosSourceConnector.java index d9f92e3731cd1..a1a57626d564f 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/CosmosDBSourceConnector.java +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/CosmosSourceConnector.java @@ -43,8 +43,8 @@ /*** * The CosmosDb source connector. */ -public class CosmosDBSourceConnector extends SourceConnector { - private static final Logger LOGGER = LoggerFactory.getLogger(CosmosDBSourceConnector.class); +public class CosmosSourceConnector extends SourceConnector implements AutoCloseable { + private static final Logger LOGGER = LoggerFactory.getLogger(CosmosSourceConnector.class); private CosmosSourceConfig config; private CosmosAsyncClient cosmosClient; private MetadataMonitorThread monitorThread; @@ -347,4 +347,9 @@ private Map getContainersTopicMap(List parsedConfig) { + super(config, parsedConfig); + this.accountConfig = this.parseAccountConfig(); + } + + private CosmosAccountConfig parseAccountConfig() { + String endpoint = this.getString(ACCOUNT_ENDPOINT_CONFIG); + String accountKey = this.getPassword(ACCOUNT_KEY_CONFIG).value(); + String applicationName = this.getString(APPLICATION_NAME); + boolean useGatewayMode = this.getBoolean(USE_GATEWAY_MODE); + List preferredRegionList = this.getPreferredRegionList(); + + return new CosmosAccountConfig( + endpoint, + accountKey, + applicationName, + useGatewayMode, + preferredRegionList); + } + + private List getPreferredRegionList() { + return convertToList(this.getString(PREFERRED_REGIONS_LIST)); + } + + public static ConfigDef getConfigDef() { + ConfigDef configDef = new ConfigDef(); + + defineAccountConfig(configDef); + + return configDef; + } + + private static void defineAccountConfig(ConfigDef result) { + final String accountGroupName = "account"; + int accountGroupOrder = 0; + + // For optional config, need to provide a default value + result + .define( + ACCOUNT_ENDPOINT_CONFIG, + ConfigDef.Type.STRING, + ConfigDef.NO_DEFAULT_VALUE, + new AccountEndpointValidator(), + ConfigDef.Importance.HIGH, + ACCOUNT_ENDPOINT_CONFIG_DOC, + accountGroupName, + accountGroupOrder++, + ConfigDef.Width.LONG, + ACCOUNT_ENDPOINT_CONFIG_DISPLAY + ) + .define( + ACCOUNT_KEY_CONFIG, + ConfigDef.Type.PASSWORD, + ConfigDef.NO_DEFAULT_VALUE, + ConfigDef.Importance.HIGH, + ACCOUNT_KEY_CONFIG_DOC, + accountGroupName, + accountGroupOrder++, + ConfigDef.Width.LONG, + ACCOUNT_KEY_CONFIG_DISPLAY + ) + .define( + APPLICATION_NAME, + ConfigDef.Type.STRING, + Strings.Emtpy, + ConfigDef.Importance.MEDIUM, + APPLICATION_NAME_DOC, + accountGroupName, + accountGroupOrder++, + ConfigDef.Width.LONG, + APPLICATION_NAME_DISPLAY + ) + .define( + USE_GATEWAY_MODE, + ConfigDef.Type.BOOLEAN, + DEFAULT_USE_GATEWAY_MODE, + ConfigDef.Importance.LOW, + USE_GATEWAY_MODE_DOC, + accountGroupName, + accountGroupOrder++, + ConfigDef.Width.MEDIUM, + USE_GATEWAY_MODE_DISPLAY + ) + .define( + PREFERRED_REGIONS_LIST, + ConfigDef.Type.STRING, + Strings.Emtpy, + ConfigDef.Importance.HIGH, + PREFERRED_REGIONS_LIST_DOC, + accountGroupName, + accountGroupOrder++, + ConfigDef.Width.LONG, + PREFERRED_REGIONS_LIST_DISPLAY + ); + } + + public CosmosAccountConfig getAccountConfig() { + return accountConfig; + } + + protected static List convertToList(String configValue) { + if (StringUtils.isNotEmpty(configValue)) { + if (configValue.startsWith("[") && configValue.endsWith("]")) { + configValue = configValue.substring(1, configValue.length() - 1); + } + + return Arrays.stream(configValue.split(",")).map(String::trim).collect(Collectors.toList()); + } + + return new ArrayList<>(); + } + + public static class AccountEndpointValidator implements ConfigDef.Validator { + @Override + @SuppressWarnings("unchecked") + public void ensureValid(String name, Object o) { + String accountEndpointUriString = (String) o; + if (StringUtils.isEmpty(accountEndpointUriString)) { + throw new ConfigException(name, o, "Account endpoint can not be empty"); + } + + try { + new URL(accountEndpointUriString); + } catch (MalformedURLException e) { + throw new ConfigException(name, o, "Invalid account endpoint."); + } + } + + @Override + public String toString() { + return "Account endpoint"; + } + } + + public static class ContainersTopicMapValidator implements ConfigDef.Validator { + private static final String INVALID_TOPIC_MAP_FORMAT = + "Invalid entry for topic-container map. The topic-container map should be a comma-delimited " + + "list of Kafka topic to Cosmos containers. Each mapping should be a pair of Kafka " + + "topic and Cosmos container separated by '#'. For example: topic1#con1,topic2#con2."; + + @Override + @SuppressWarnings("unchecked") + public void ensureValid(String name, Object o) { + String configValue = (String) o; + if (StringUtils.isEmpty(configValue)) { + return; + } + + List containerTopicMapList = convertToList(configValue); + + // validate each item should be in topic#container format + boolean invalidFormatExists = + containerTopicMapList + .stream() + .anyMatch(containerTopicMap -> + containerTopicMap + .split(CosmosSourceContainersConfig.CONTAINER_TOPIC_MAP_SEPARATOR) + .length != 2); + + if (invalidFormatExists) { + throw new ConfigException(name, o, INVALID_TOPIC_MAP_FORMAT); + } + } + + @Override + public String toString() { + return "Containers topic map"; + } + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/KafkaCosmosConstants.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/KafkaCosmosConstants.java index e2d80b719e4ea..50db99a79c634 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/KafkaCosmosConstants.java +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/KafkaCosmosConstants.java @@ -3,13 +3,20 @@ package com.azure.cosmos.kafka.connect.implementation; +import com.azure.core.util.CoreUtils; + public class KafkaCosmosConstants { + public static final String PROPERTIES_FILE_NAME = "azure-cosmos-kafka-connect.properties"; + public static final String CURRENT_VERSION = CoreUtils.getProperties(PROPERTIES_FILE_NAME).get("version"); + public static final String CURRENT_NAME = CoreUtils.getProperties(PROPERTIES_FILE_NAME).get("name"); + public static final String USER_AGENT_SUFFIX = String.format("KafkaConnect/%s/%s", CURRENT_NAME, CURRENT_VERSION); public static class StatusCodes { public static final int NOTFOUND = 404; public static final int REQUEST_TIMEOUT = 408; public static final int GONE = 410; - + public static final int CONFLICT = 409; + public static final int PRECONDITION_FAILED = 412; public static final int SERVICE_UNAVAILABLE = 503; public static final int INTERNAL_SERVER_ERROR = 500; } diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/KafkaCosmosExceptionsHelper.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/KafkaCosmosExceptionsHelper.java new file mode 100644 index 0000000000000..a8adfd35a22ab --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/KafkaCosmosExceptionsHelper.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation; + +import com.azure.cosmos.CosmosException; +import org.apache.kafka.connect.errors.ConnectException; +import org.apache.kafka.connect.errors.RetriableException; + +public class KafkaCosmosExceptionsHelper { + public static boolean isTransientFailure(int statusCode, int substatusCode) { + return statusCode == KafkaCosmosConstants.StatusCodes.GONE + || statusCode == KafkaCosmosConstants.StatusCodes.SERVICE_UNAVAILABLE + || statusCode == KafkaCosmosConstants.StatusCodes.INTERNAL_SERVER_ERROR + || statusCode == KafkaCosmosConstants.StatusCodes.REQUEST_TIMEOUT + || (statusCode == KafkaCosmosConstants.StatusCodes.NOTFOUND && substatusCode == KafkaCosmosConstants.SubStatusCodes.READ_SESSION_NOT_AVAILABLE); + + } + + public static boolean isTransientFailure(Throwable e) { + if (e instanceof CosmosException) { + return isTransientFailure(((CosmosException) e).getStatusCode(), ((CosmosException) e).getSubStatusCode()); + } + + return false; + } + + public static boolean isFeedRangeGoneException(Throwable throwable) { + if (throwable instanceof CosmosException) { + return isFeedRangeGoneException( + ((CosmosException) throwable).getStatusCode(), + ((CosmosException) throwable).getSubStatusCode()); + } + + return false; + } + + public static boolean isFeedRangeGoneException(int statusCode, int substatusCode) { + return statusCode == KafkaCosmosConstants.StatusCodes.GONE + && (substatusCode == KafkaCosmosConstants.SubStatusCodes.PARTITION_KEY_RANGE_GONE + || substatusCode == KafkaCosmosConstants.SubStatusCodes.COMPLETING_SPLIT_OR_MERGE); + } + + public static ConnectException convertToConnectException(Throwable throwable, String message) { + if (KafkaCosmosExceptionsHelper.isTransientFailure(throwable)) { + return new RetriableException(message, throwable); + } + + return new ConnectException(message, throwable); + } + + public static boolean isResourceExistsException(Throwable throwable) { + if (throwable instanceof CosmosException) { + return ((CosmosException) throwable).getStatusCode() == KafkaCosmosConstants.StatusCodes.CONFLICT; + } + + return false; + } + + public static boolean isNotFoundException(Throwable throwable) { + if (throwable instanceof CosmosException) { + return ((CosmosException) throwable).getStatusCode() == KafkaCosmosConstants.StatusCodes.NOTFOUND; + } + + return false; + } + + public static boolean isPreconditionFailedException(Throwable throwable) { + if (throwable instanceof CosmosException) { + return ((CosmosException) throwable).getStatusCode() == KafkaCosmosConstants.StatusCodes.PRECONDITION_FAILED; + } + + return false; + } + + public static boolean isTimeoutException(Throwable throwable) { + if (throwable instanceof CosmosException) { + return ((CosmosException) throwable).getStatusCode() == KafkaCosmosConstants.StatusCodes.REQUEST_TIMEOUT; + } + + return false; + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/KafkaCosmosSchedulers.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/KafkaCosmosSchedulers.java new file mode 100644 index 0000000000000..58784644d9620 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/KafkaCosmosSchedulers.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation; + +import reactor.core.scheduler.Scheduler; +import reactor.core.scheduler.Schedulers; + +public class KafkaCosmosSchedulers { + private static final String SINK_BOUNDED_ELASTIC_THREAD_NAME = "kafka-cosmos-sink-bounded-elastic"; + private static final int TTL_FOR_SCHEDULER_WORKER_IN_SECONDS = 60; // same as BoundedElasticScheduler.DEFAULT_TTL_SECONDS + public static final Scheduler SINK_BOUNDED_ELASTIC = Schedulers.newBoundedElastic( + Schedulers.DEFAULT_BOUNDED_ELASTIC_SIZE, + Schedulers.DEFAULT_BOUNDED_ELASTIC_QUEUESIZE, + SINK_BOUNDED_ELASTIC_THREAD_NAME, + TTL_FOR_SCHEDULER_WORKER_IN_SECONDS, + true + ); +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkConfig.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkConfig.java new file mode 100644 index 0000000000000..d029105846a56 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkConfig.java @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink; + +import com.azure.cosmos.implementation.apachecommons.lang.StringUtils; +import com.azure.cosmos.kafka.connect.implementation.KafkaCosmosConfig; +import org.apache.kafka.common.config.ConfigDef; +import org.apache.kafka.common.config.ConfigException; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * Common Configuration for Cosmos DB Kafka sink connector. + */ +public class CosmosSinkConfig extends KafkaCosmosConfig { + private static final String SINK_CONFIG_PREFIX = "kafka.connect.cosmos.sink."; + + // error tolerance + public static final String TOLERANCE_ON_ERROR_CONFIG = SINK_CONFIG_PREFIX + "errors.tolerance"; + public static final String TOLERANCE_ON_ERROR_DOC = + "Error tolerance level after exhausting all retries. 'None' for fail on error. 'All' for log and continue"; + public static final String TOLERANCE_ON_ERROR_DISPLAY = "Error tolerance level."; + public static final String DEFAULT_TOLERANCE_ON_ERROR = ToleranceOnErrorLevel.NONE.getName(); + + // sink bulk config + public static final String BULK_ENABLED_CONF = SINK_CONFIG_PREFIX + "bulk.enabled"; + private static final String BULK_ENABLED_DOC = + "Flag to indicate whether Cosmos DB bulk mode is enabled for Sink connector. By default it is true."; + private static final String BULK_ENABLED_DISPLAY = "enable bulk mode."; + private static final boolean DEFAULT_BULK_ENABLED = true; + + // TODO[Public Preview]: Add other write config, for example patch, bulkUpdate + public static final String BULK_MAX_CONCURRENT_PARTITIONS_CONF = SINK_CONFIG_PREFIX + "bulk.maxConcurrentCosmosPartitions"; + private static final String BULK_MAX_CONCURRENT_PARTITIONS_DOC = + "Cosmos DB Item Write Max Concurrent Cosmos Partitions." + + " If not specified it will be determined based on the number of the container's physical partitions -" + + " which would indicate every batch is expected to have data from all Cosmos physical partitions." + + " If specified it indicates from at most how many Cosmos Physical Partitions each batch contains data." + + " So this config can be used to make bulk processing more efficient when input data in each batch has been" + + " repartitioned to balance to how many Cosmos partitions each batch needs to write. This is mainly" + + " useful for very large containers (with hundreds of physical partitions)."; + private static final String BULK_MAX_CONCURRENT_PARTITIONS_DISPLAY = "Cosmos DB Item Write Max Concurrent Cosmos Partitions."; + private static final int DEFAULT_BULK_MAX_CONCURRENT_PARTITIONS = -1; + + public static final String BULK_INITIAL_BATCH_SIZE_CONF = SINK_CONFIG_PREFIX + "bulk.initialBatchSize"; + private static final String BULK_INITIAL_BATCH_SIZE_DOC = + "Cosmos DB initial bulk micro batch size - a micro batch will be flushed to the backend " + + "when the number of documents enqueued exceeds this size - or the target payload size is met. The micro batch " + + "size is getting automatically tuned based on the throttling rate. By default the " + + "initial micro batch size is 1. Reduce this when you want to avoid that the first few requests consume " + + "too many RUs."; + private static final String BULK_INITIAL_BATCH_SIZE_DISPLAY = "Cosmos DB initial bulk micro batch size."; + private static final int DEFAULT_BULK_INITIAL_BATCH_SIZE = 1; // start with small value to avoid initial RU spike + + // write strategy + public static final String WRITE_STRATEGY_CONF = SINK_CONFIG_PREFIX + "write.strategy"; + private static final String WRITE_STRATEGY_DOC = "Cosmos DB Item write Strategy: `ItemOverwrite` (using upsert), `ItemAppend` (using create, " + + "ignore pre-existing items i.e., Conflicts), `ItemDelete` (deletes based on id/pk of data frame), " + + "`ItemDeleteIfNotModified` (deletes based on id/pk of data frame if etag hasn't changed since collecting " + + "id/pk), `ItemOverwriteIfNotModified` (using create if etag is empty, update/replace with etag pre-condition " + + "otherwise, if document was updated the pre-condition failure is ignored)"; + private static final String WRITE_STRATEGY_DISPLAY = "Cosmos DB Item write Strategy."; + private static final String DEFAULT_WRITE_STRATEGY = ItemWriteStrategy.ITEM_OVERWRITE.getName(); + + // max retry + public static final String MAX_RETRY_COUNT_CONF = SINK_CONFIG_PREFIX + "maxRetryCount"; + private static final String MAX_RETRY_COUNT_DOC = + "Cosmos DB max retry attempts on write failures for Sink connector. By default, the connector will retry on transient write errors for up to 10 times."; + private static final String MAX_RETRY_COUNT_DISPLAY = "Cosmos DB max retry attempts on write failures for Sink connector."; + private static final int DEFAULT_MAX_RETRY_COUNT = 10; + + // database name + private static final String DATABASE_NAME_CONF = SINK_CONFIG_PREFIX + "database.name"; + private static final String DATABASE_NAME_CONF_DOC = "Cosmos DB database name."; + private static final String DATABASE_NAME_CONF_DISPLAY = "Cosmos DB database name."; + + // container topic map + public static final String CONTAINERS_TOPIC_MAP_CONF = SINK_CONFIG_PREFIX + "containers.topicMap"; + private static final String CONTAINERS_TOPIC_MAP_DOC = + "A comma delimited list of Kafka topics mapped to Cosmos containers. For example: topic1#con1,topic2#con2."; + private static final String CONTAINERS_TOPIC_MAP_DISPLAY = "Topic-Container map"; + + // TODO[Public preview]: re-examine idStrategy implementation + // id.strategy + public static final String ID_STRATEGY_CONF = SINK_CONFIG_PREFIX + "id.strategy"; + public static final String ID_STRATEGY_DOC = + "A strategy used to populate the document with an ``id``. Valid strategies are: " + + "``TemplateStrategy``, ``FullKeyStrategy``, ``KafkaMetadataStrategy``, " + + "``ProvidedInKeyStrategy``, ``ProvidedInValueStrategy``. Configuration " + + "properties prefixed with``id.strategy`` are passed through to the strategy. For " + + "example, when using ``id.strategy=TemplateStrategy`` , " + + "the property ``id.strategy.template`` is passed through to the template strategy " + + "and used to specify the template string to be used in constructing the ``id``."; + public static final String ID_STRATEGY_DISPLAY = "ID Strategy"; + public static final String DEFAULT_ID_STRATEGY = IdStrategies.PROVIDED_IN_VALUE_STRATEGY.getName(); + + // TODO[Public Preview] Verify whether compression need to happen in connector + + private final CosmosSinkWriteConfig writeConfig; + private final CosmosSinkContainersConfig containersConfig; + private final IdStrategies idStrategy; + + public CosmosSinkConfig(Map parsedConfig) { + this(getConfigDef(), parsedConfig); + } + + public CosmosSinkConfig(ConfigDef config, Map parsedConfig) { + super(config, parsedConfig); + this.writeConfig = this.parseWriteConfig(); + this.containersConfig = this.parseContainersConfig(); + this.idStrategy = this.parseIdStrategy(); + } + + public static ConfigDef getConfigDef() { + ConfigDef configDef = KafkaCosmosConfig.getConfigDef(); + + defineWriteConfig(configDef); + defineContainersConfig(configDef); + defineIdStrategyConfig(configDef); + return configDef; + } + + private static void defineWriteConfig(ConfigDef configDef) { + final String writeConfigGroupName = "Write config"; + int writeConfigGroupOrder = 0; + configDef + .define( + BULK_ENABLED_CONF, + ConfigDef.Type.BOOLEAN, + DEFAULT_BULK_ENABLED, + ConfigDef.Importance.MEDIUM, + BULK_ENABLED_DOC, + writeConfigGroupName, + writeConfigGroupOrder++, + ConfigDef.Width.MEDIUM, + BULK_ENABLED_DISPLAY + ) + .define( + BULK_MAX_CONCURRENT_PARTITIONS_CONF, + ConfigDef.Type.INT, + DEFAULT_BULK_MAX_CONCURRENT_PARTITIONS, + ConfigDef.Importance.LOW, + BULK_MAX_CONCURRENT_PARTITIONS_DOC, + writeConfigGroupName, + writeConfigGroupOrder++, + ConfigDef.Width.MEDIUM, + BULK_MAX_CONCURRENT_PARTITIONS_DISPLAY + ) + .define( + BULK_INITIAL_BATCH_SIZE_CONF, + ConfigDef.Type.INT, + DEFAULT_BULK_INITIAL_BATCH_SIZE, + ConfigDef.Importance.MEDIUM, + BULK_INITIAL_BATCH_SIZE_DOC, + writeConfigGroupName, + writeConfigGroupOrder++, + ConfigDef.Width.MEDIUM, + BULK_INITIAL_BATCH_SIZE_DISPLAY + ) + .define( + WRITE_STRATEGY_CONF, + ConfigDef.Type.STRING, + DEFAULT_WRITE_STRATEGY, + new ItemWriteStrategyValidator(), + ConfigDef.Importance.HIGH, + WRITE_STRATEGY_DOC, + writeConfigGroupName, + writeConfigGroupOrder++, + ConfigDef.Width.LONG, + WRITE_STRATEGY_DISPLAY + ) + .define( + MAX_RETRY_COUNT_CONF, + ConfigDef.Type.INT, + DEFAULT_MAX_RETRY_COUNT, + ConfigDef.Importance.MEDIUM, + MAX_RETRY_COUNT_DOC, + writeConfigGroupName, + writeConfigGroupOrder++, + ConfigDef.Width.MEDIUM, + MAX_RETRY_COUNT_DISPLAY + ) + .define( + TOLERANCE_ON_ERROR_CONFIG, + ConfigDef.Type.STRING, + DEFAULT_TOLERANCE_ON_ERROR, + ConfigDef.Importance.HIGH, + TOLERANCE_ON_ERROR_DOC, + writeConfigGroupName, + writeConfigGroupOrder++, + ConfigDef.Width.MEDIUM, + TOLERANCE_ON_ERROR_DISPLAY + ); + } + + private static void defineContainersConfig(ConfigDef configDef) { + final String containersGroupName = "Containers"; + int containersGroupOrder = 0; + + configDef + .define( + DATABASE_NAME_CONF, + ConfigDef.Type.STRING, + ConfigDef.NO_DEFAULT_VALUE, + NON_EMPTY_STRING, + ConfigDef.Importance.HIGH, + DATABASE_NAME_CONF_DOC, + containersGroupName, + containersGroupOrder++, + ConfigDef.Width.LONG, + DATABASE_NAME_CONF_DISPLAY + ) + .define( + CONTAINERS_TOPIC_MAP_CONF, + ConfigDef.Type.STRING, + ConfigDef.NO_DEFAULT_VALUE, + new ContainersTopicMapValidator(), + ConfigDef.Importance.MEDIUM, + CONTAINERS_TOPIC_MAP_DOC, + containersGroupName, + containersGroupOrder++, + ConfigDef.Width.LONG, + CONTAINERS_TOPIC_MAP_DISPLAY + ); + } + + private static void defineIdStrategyConfig(ConfigDef configDef) { + final String idStrategyConfigGroupName = "ID Strategy"; + int idStrategyConfigGroupOrder = 0; + configDef + .define( + ID_STRATEGY_CONF, + ConfigDef.Type.STRING, + DEFAULT_ID_STRATEGY, + ConfigDef.Importance.HIGH, + ID_STRATEGY_DOC, + idStrategyConfigGroupName, + idStrategyConfigGroupOrder++, + ConfigDef.Width.MEDIUM, + ID_STRATEGY_DISPLAY); + } + + private CosmosSinkWriteConfig parseWriteConfig() { + boolean bulkEnabled = this.getBoolean(BULK_ENABLED_CONF); + int bulkMaxConcurrentCosmosPartitions = this.getInt(BULK_MAX_CONCURRENT_PARTITIONS_CONF); + int bulkInitialBatchSize = this.getInt(BULK_INITIAL_BATCH_SIZE_CONF); + ItemWriteStrategy writeStrategy = this.parseItemWriteStrategy(); + int maxRetryCount = this.getInt(MAX_RETRY_COUNT_CONF); + ToleranceOnErrorLevel toleranceOnErrorLevel = this.parseToleranceOnErrorLevel(); + + return new CosmosSinkWriteConfig( + bulkEnabled, + bulkMaxConcurrentCosmosPartitions, + bulkInitialBatchSize, + writeStrategy, + maxRetryCount, + toleranceOnErrorLevel); + } + + private CosmosSinkContainersConfig parseContainersConfig() { + String databaseName = this.getString(DATABASE_NAME_CONF); + Map topicToContainerMap = this.getTopicToContainerMap(); + + return new CosmosSinkContainersConfig(databaseName, topicToContainerMap); + } + + private Map getTopicToContainerMap() { + List containersTopicMapList = convertToList(this.getString(CONTAINERS_TOPIC_MAP_CONF)); + return containersTopicMapList + .stream() + .map(containerTopicMapString -> containerTopicMapString.split("#")) + .collect( + Collectors.toMap( + containerTopicMapArray -> containerTopicMapArray[0], + containerTopicMapArray -> containerTopicMapArray[1])); + } + + private ItemWriteStrategy parseItemWriteStrategy() { + return ItemWriteStrategy.fromName(this.getString(WRITE_STRATEGY_CONF)); + } + + private ToleranceOnErrorLevel parseToleranceOnErrorLevel() { + return ToleranceOnErrorLevel.fromName(this.getString(TOLERANCE_ON_ERROR_CONFIG)); + } + + private IdStrategies parseIdStrategy() { + return IdStrategies.fromName(this.getString(ID_STRATEGY_CONF)); + } + + public CosmosSinkWriteConfig getWriteConfig() { + return writeConfig; + } + + public CosmosSinkContainersConfig getContainersConfig() { + return containersConfig; + } + + public IdStrategies getIdStrategy() { + return idStrategy; + } + + public static class ItemWriteStrategyValidator implements ConfigDef.Validator { + @Override + @SuppressWarnings("unchecked") + public void ensureValid(String name, Object o) { + String itemWriteStrategyString = (String) o; + if (StringUtils.isEmpty(itemWriteStrategyString)) { + throw new ConfigException(name, o, "WriteStrategy can not be empty or null"); + } + + ItemWriteStrategy itemWriteStrategy = ItemWriteStrategy.fromName(itemWriteStrategyString); + if (itemWriteStrategy == null) { + throw new ConfigException(name, o, "Invalid ItemWriteStrategy. Allowed values " + ItemWriteStrategy.values()); + } + } + + @Override + public String toString() { + return "ItemWriteStrategy. Only allow " + ItemWriteStrategy.values(); + } + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkContainersConfig.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkContainersConfig.java new file mode 100644 index 0000000000000..9cb3273f8ebda --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkContainersConfig.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink; + +import java.util.Map; + +public class CosmosSinkContainersConfig { + private final String databaseName; + private final Map topicToContainerMap; + + public CosmosSinkContainersConfig(String databaseName, Map topicToContainerMap) { + this.databaseName = databaseName; + this.topicToContainerMap = topicToContainerMap; + } + + public String getDatabaseName() { + return databaseName; + } + + public Map getTopicToContainerMap() { + return topicToContainerMap; + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkTask.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkTask.java new file mode 100644 index 0000000000000..eba1e942732c8 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkTask.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink; + +import com.azure.cosmos.CosmosAsyncClient; +import com.azure.cosmos.CosmosAsyncContainer; +import com.azure.cosmos.implementation.apachecommons.lang.StringUtils; +import com.azure.cosmos.kafka.connect.implementation.CosmosClientStore; +import com.azure.cosmos.kafka.connect.implementation.KafkaCosmosConstants; +import org.apache.kafka.connect.sink.SinkRecord; +import org.apache.kafka.connect.sink.SinkTask; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class CosmosSinkTask extends SinkTask { + private static final Logger LOGGER = LoggerFactory.getLogger(CosmosSinkTask.class); + private CosmosSinkTaskConfig sinkTaskConfig; + private CosmosAsyncClient cosmosClient; + private SinkRecordTransformer sinkRecordTransformer; + private IWriter cosmosWriter; + + @Override + public String version() { + return KafkaCosmosConstants.CURRENT_VERSION; + } + + @Override + public void start(Map props) { + LOGGER.info("Starting the kafka cosmos sink task"); + this.sinkTaskConfig = new CosmosSinkTaskConfig(props); + this.cosmosClient = CosmosClientStore.getCosmosClient(this.sinkTaskConfig.getAccountConfig()); + this.sinkRecordTransformer = new SinkRecordTransformer(this.sinkTaskConfig); + + if (this.sinkTaskConfig.getWriteConfig().isBulkEnabled()) { + this.cosmosWriter = + new KafkaCosmosBulkWriter(this.sinkTaskConfig.getWriteConfig(), this.context.errantRecordReporter()); + } else { + this.cosmosWriter = + new KafkaCosmosPointWriter(this.sinkTaskConfig.getWriteConfig(), context.errantRecordReporter()); + } + + // TODO[public preview]: in V1, it will create the database if does not exists, but why? + } + + @Override + public void put(Collection records) { + if (records == null || records.isEmpty()) { + LOGGER.debug("No records to be written"); + return; + } + + LOGGER.debug("Sending {} records to be written", records.size()); + + // group by container + Map> recordsByContainer = + records.stream().collect( + Collectors.groupingBy( + record -> this.sinkTaskConfig + .getContainersConfig() + .getTopicToContainerMap() + .getOrDefault(record.topic(), StringUtils.EMPTY))); + + if (recordsByContainer.containsKey(StringUtils.EMPTY)) { + throw new IllegalStateException("There is no container defined for topics " + recordsByContainer.get(StringUtils.EMPTY)); + } + + for (Map.Entry> entry : recordsByContainer.entrySet()) { + String containerName = entry.getKey(); + CosmosAsyncContainer container = + this.cosmosClient + .getDatabase(this.sinkTaskConfig.getContainersConfig().getDatabaseName()) + .getContainer(containerName); + + // transform sink records, for example populating id + List transformedRecords = sinkRecordTransformer.transform(containerName, entry.getValue()); + this.cosmosWriter.write(container, transformedRecords); + } + } + + @Override + public void stop() { + LOGGER.info("Stopping Kafka CosmosDB sink task"); + if (this.cosmosClient != null) { + this.cosmosClient.close(); + } + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkTaskConfig.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkTaskConfig.java new file mode 100644 index 0000000000000..f438f3f620eb9 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkTaskConfig.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink; + +import java.util.Map; + +// Currently the sink task config shares the same config as sink connector config +public class CosmosSinkTaskConfig extends CosmosSinkConfig { + public CosmosSinkTaskConfig(Map parsedConfig) { + super(parsedConfig); + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkWriteConfig.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkWriteConfig.java new file mode 100644 index 0000000000000..98d758deb6e3d --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkWriteConfig.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink; + +public class CosmosSinkWriteConfig { + private final boolean bulkEnabled; + private final int bulkMaxConcurrentCosmosPartitions; + private final int bulkInitialBatchSize; + private final ItemWriteStrategy itemWriteStrategy; + private final int maxRetryCount; + + private final ToleranceOnErrorLevel toleranceOnErrorLevel; + + public CosmosSinkWriteConfig( + boolean bulkEnabled, + int bulkMaxConcurrentCosmosPartitions, + int bulkInitialBatchSize, + ItemWriteStrategy itemWriteStrategy, + int maxRetryCount, + ToleranceOnErrorLevel toleranceOnErrorLevel) { + + this.bulkEnabled = bulkEnabled; + this.bulkMaxConcurrentCosmosPartitions = bulkMaxConcurrentCosmosPartitions; + this.bulkInitialBatchSize = bulkInitialBatchSize; + this.itemWriteStrategy = itemWriteStrategy; + this.maxRetryCount = maxRetryCount; + this.toleranceOnErrorLevel = toleranceOnErrorLevel; + } + + public boolean isBulkEnabled() { + return bulkEnabled; + } + + public int getBulkMaxConcurrentCosmosPartitions() { + return bulkMaxConcurrentCosmosPartitions; + } + + public int getBulkInitialBatchSize() { + return bulkInitialBatchSize; + } + + public ItemWriteStrategy getItemWriteStrategy() { + return itemWriteStrategy; + } + + public int getMaxRetryCount() { + return maxRetryCount; + } + + public ToleranceOnErrorLevel getToleranceOnErrorLevel() { + return toleranceOnErrorLevel; + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosWriteException.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosWriteException.java new file mode 100644 index 0000000000000..7892212fb2e47 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosWriteException.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink; + +import org.apache.kafka.connect.errors.ConnectException; + +/** + * Generic CosmosDb sink write exceptions. + */ +public class CosmosWriteException extends ConnectException { + private static final long serialVersionUID = 1L; + + public CosmosWriteException(String message) { + super(message); + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/IWriter.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/IWriter.java new file mode 100644 index 0000000000000..18cee5577b7d6 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/IWriter.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink; + +import com.azure.cosmos.CosmosAsyncContainer; +import org.apache.kafka.connect.sink.SinkRecord; + +import java.util.List; + +public interface IWriter { + void write(CosmosAsyncContainer container, List sinkRecords); +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/IdStrategies.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/IdStrategies.java new file mode 100644 index 0000000000000..dcc3568dc2fb1 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/IdStrategies.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink; + +public enum IdStrategies { + TEMPLATE_STRATEGY("TemplateStrategy"), + FULL_KEY_STRATEGY("FullKeyStrategy"), + KAFKA_METADATA_STRATEGY("KafkaMetadataStrategy"), + PROVIDED_IN_KEY_STRATEGY("ProvidedInKeyStrategy"), + PROVIDED_IN_VALUE_STRATEGY("ProvidedInValueStrategy"); + + private final String name; + + IdStrategies(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public static IdStrategies fromName(String name) { + for (IdStrategies mode : IdStrategies.values()) { + if (mode.getName().equalsIgnoreCase(name)) { + return mode; + } + } + return null; + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/ItemWriteStrategy.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/ItemWriteStrategy.java new file mode 100644 index 0000000000000..988f577b5a267 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/ItemWriteStrategy.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink; + +public enum ItemWriteStrategy { + ITEM_OVERWRITE("ItemOverwrite"), + ITEM_APPEND("ItemAppend"), + ITEM_DELETE("ItemDelete"), + ITEM_DELETE_IF_NOT_MODIFIED("ItemDeleteIfNotModified"), + ITEM_OVERWRITE_IF_NOT_MODIFIED("ItemOverwriteIfNotModified"); + + // TODO[Public Preview] Add ItemPatch, ItemBulkUpdate + private final String name; + + ItemWriteStrategy(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public static ItemWriteStrategy fromName(String name) { + for (ItemWriteStrategy mode : ItemWriteStrategy.values()) { + if (mode.getName().equalsIgnoreCase(name)) { + return mode; + } + } + return null; + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/KafkaCosmosBulkWriter.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/KafkaCosmosBulkWriter.java new file mode 100644 index 0000000000000..2044d84c33018 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/KafkaCosmosBulkWriter.java @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink; + +import com.azure.cosmos.BridgeInternal; +import com.azure.cosmos.CosmosAsyncContainer; +import com.azure.cosmos.CosmosException; +import com.azure.cosmos.implementation.HttpConstants; +import com.azure.cosmos.implementation.ImplementationBridgeHelpers; +import com.azure.cosmos.implementation.apachecommons.lang.StringUtils; +import com.azure.cosmos.kafka.connect.implementation.KafkaCosmosExceptionsHelper; +import com.azure.cosmos.kafka.connect.implementation.KafkaCosmosSchedulers; +import com.azure.cosmos.models.CosmosBulkExecutionOptions; +import com.azure.cosmos.models.CosmosBulkItemRequestOptions; +import com.azure.cosmos.models.CosmosBulkItemResponse; +import com.azure.cosmos.models.CosmosBulkOperationResponse; +import com.azure.cosmos.models.CosmosBulkOperations; +import com.azure.cosmos.models.CosmosItemOperation; +import com.azure.cosmos.models.PartitionKeyDefinition; +import org.apache.kafka.connect.sink.ErrantRecordReporter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.core.publisher.SignalType; +import reactor.core.publisher.Sinks; + +import java.time.Duration; +import java.util.List; +import java.util.Random; +import java.util.concurrent.atomic.AtomicInteger; + +import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; + +public class KafkaCosmosBulkWriter extends KafkaCosmosWriterBase { + private static final Logger LOGGER = LoggerFactory.getLogger(KafkaCosmosBulkWriter.class); + private static final int MAX_DELAY_ON_408_REQUEST_TIMEOUT_IN_MS = 10000; + private static final int MIN_DELAY_ON_408_REQUEST_TIMEOUT_IN_MS = 1000; + private static final Random RANDOM = new Random(); + + private final CosmosSinkWriteConfig writeConfig; + private final Sinks.EmitFailureHandler emitFailureHandler; + + public KafkaCosmosBulkWriter( + CosmosSinkWriteConfig writeConfig, + ErrantRecordReporter errantRecordReporter) { + super(errantRecordReporter); + checkNotNull(writeConfig, "Argument 'writeConfig' can not be null"); + + this.writeConfig = writeConfig; + this.emitFailureHandler = new KafkaCosmosEmitFailureHandler(); + } + + @Override + public void writeCore(CosmosAsyncContainer container, List sinkOperations) { + Sinks.Many bulkRetryEmitter = Sinks.many().unicast().onBackpressureBuffer(); + CosmosBulkExecutionOptions bulkExecutionOptions = this.getBulkExecutionOperations(); + AtomicInteger totalPendingRecords = new AtomicInteger(sinkOperations.size()); + Runnable onTaskCompleteCheck = () -> { + if (totalPendingRecords.decrementAndGet() <= 0) { + bulkRetryEmitter.emitComplete(emitFailureHandler); + } + }; + + Flux.fromIterable(sinkOperations) + .flatMap(sinkOperation -> this.getBulkOperation(container, sinkOperation)) + .collectList() + .flatMapMany(itemOperations -> { + + Flux> cosmosBulkOperationResponseFlux = + container + .executeBulkOperations( + Flux.fromIterable(itemOperations) + .mergeWith(bulkRetryEmitter.asFlux()) + .publishOn(KafkaCosmosSchedulers.SINK_BOUNDED_ELASTIC), + bulkExecutionOptions); + return cosmosBulkOperationResponseFlux; + }) + .flatMap(itemResponse -> { + SinkOperation sinkOperation = itemResponse.getOperation().getContext(); + checkNotNull(sinkOperation, "sinkOperation should not be null"); + + if (itemResponse.getResponse() != null && itemResponse.getResponse().isSuccessStatusCode()) { + // success + this.completeSinkOperation(sinkOperation, onTaskCompleteCheck); + } else { + BulkOperationFailedException exception = handleErrorStatusCode( + itemResponse.getResponse(), + itemResponse.getException(), + sinkOperation); + + if (shouldIgnore(exception)) { + this.completeSinkOperation(sinkOperation, onTaskCompleteCheck); + } else { + if (shouldRetry(exception, sinkOperation.getRetryCount(), this.writeConfig.getMaxRetryCount())) { + sinkOperation.setException(exception); + return this.scheduleRetry(container, itemResponse.getOperation().getContext(), bulkRetryEmitter, exception); + } else { + // operation failed after exhausting all retries + this.completeSinkOperationWithFailure(sinkOperation, exception, onTaskCompleteCheck); + if (this.writeConfig.getToleranceOnErrorLevel() == ToleranceOnErrorLevel.ALL) { + LOGGER.warn( + "Could not upload record {} to CosmosDB after exhausting all retries, " + + "but ToleranceOnErrorLevel is all, will only log the error message. ", + sinkOperation.getSinkRecord().key(), + sinkOperation.getException()); + return Mono.empty(); + } else { + return Mono.error(exception); + } + } + } + } + + return Mono.empty(); + }) + .subscribeOn(KafkaCosmosSchedulers.SINK_BOUNDED_ELASTIC) + .blockLast(); + } + + private CosmosBulkExecutionOptions getBulkExecutionOperations() { + CosmosBulkExecutionOptions bulkExecutionOptions = new CosmosBulkExecutionOptions(); + bulkExecutionOptions.setInitialMicroBatchSize(this.writeConfig.getBulkInitialBatchSize()); + if (this.writeConfig.getBulkMaxConcurrentCosmosPartitions() > 0) { + ImplementationBridgeHelpers + .CosmosBulkExecutionOptionsHelper + .getCosmosBulkExecutionOptionsAccessor() + .setMaxConcurrentCosmosPartitions(bulkExecutionOptions, this.writeConfig.getBulkMaxConcurrentCosmosPartitions()); + } + + return bulkExecutionOptions; + } + + private Mono getBulkOperation( + CosmosAsyncContainer container, + SinkOperation sinkOperation) { + return ImplementationBridgeHelpers + .CosmosAsyncContainerHelper + .getCosmosAsyncContainerAccessor() + .getPartitionKeyDefinition(container) + .flatMap(partitionKeyDefinition -> { + CosmosItemOperation cosmosItemOperation; + + switch (this.writeConfig.getItemWriteStrategy()) { + case ITEM_OVERWRITE: + cosmosItemOperation = this.getUpsertItemOperation(sinkOperation, partitionKeyDefinition); + break; + case ITEM_OVERWRITE_IF_NOT_MODIFIED: + String etag = getEtag(sinkOperation.getSinkRecord().value()); + if (StringUtils.isEmpty(etag)) { + cosmosItemOperation = this.getCreateItemOperation(sinkOperation, partitionKeyDefinition); + } else { + cosmosItemOperation = this.getReplaceItemOperation(sinkOperation, partitionKeyDefinition, etag); + } + break; + case ITEM_APPEND: + cosmosItemOperation = this.getCreateItemOperation(sinkOperation, partitionKeyDefinition); + break; + case ITEM_DELETE: + cosmosItemOperation = this.getDeleteItemOperation(sinkOperation, partitionKeyDefinition, null); + break; + case ITEM_DELETE_IF_NOT_MODIFIED: + String itemDeleteEtag = getEtag(sinkOperation.getSinkRecord().value()); + cosmosItemOperation = this.getDeleteItemOperation(sinkOperation, partitionKeyDefinition, itemDeleteEtag); + break; + default: + return Mono.error(new IllegalArgumentException(this.writeConfig.getItemWriteStrategy() + " is not supported")); + } + + return Mono.just(cosmosItemOperation); + }); + } + + private CosmosItemOperation getUpsertItemOperation( + SinkOperation sinkOperation, + PartitionKeyDefinition partitionKeyDefinition) { + + return CosmosBulkOperations.getUpsertItemOperation( + sinkOperation.getSinkRecord().value(), + this.getPartitionKeyValue(sinkOperation.getSinkRecord().value(), partitionKeyDefinition), + sinkOperation); + } + + private CosmosItemOperation getCreateItemOperation( + SinkOperation sinkOperation, + PartitionKeyDefinition partitionKeyDefinition) { + return CosmosBulkOperations.getCreateItemOperation( + sinkOperation.getSinkRecord().value(), + this.getPartitionKeyValue(sinkOperation.getSinkRecord().value(), partitionKeyDefinition), + sinkOperation); + } + + private CosmosItemOperation getReplaceItemOperation( + SinkOperation sinkOperation, + PartitionKeyDefinition partitionKeyDefinition, + String etag) { + + CosmosBulkItemRequestOptions itemRequestOptions = new CosmosBulkItemRequestOptions(); + if (StringUtils.isNotEmpty(etag)) { + itemRequestOptions.setIfMatchETag(etag); + } + + return CosmosBulkOperations.getReplaceItemOperation( + getId(sinkOperation.getSinkRecord().value()), + sinkOperation.getSinkRecord().value(), + this.getPartitionKeyValue(sinkOperation.getSinkRecord().value(), partitionKeyDefinition), + new CosmosBulkItemRequestOptions().setIfMatchETag(etag), + sinkOperation); + } + + private CosmosItemOperation getDeleteItemOperation( + SinkOperation sinkOperation, + PartitionKeyDefinition partitionKeyDefinition, + String etag) { + + CosmosBulkItemRequestOptions itemRequestOptions = new CosmosBulkItemRequestOptions(); + if (StringUtils.isNotEmpty(etag)) { + itemRequestOptions.setIfMatchETag(etag); + } + + return CosmosBulkOperations.getDeleteItemOperation( + this.getId(sinkOperation.getSinkRecord().value()), + this.getPartitionKeyValue(sinkOperation.getSinkRecord().value(), partitionKeyDefinition), + itemRequestOptions, + sinkOperation); + } + + private Mono scheduleRetry( + CosmosAsyncContainer container, + SinkOperation sinkOperation, + Sinks.Many bulkRetryEmitter, + BulkOperationFailedException exception) { + + sinkOperation.retry(); + Mono retryMono = + getBulkOperation(container, sinkOperation) + .flatMap(itemOperation -> { + bulkRetryEmitter.emitNext(itemOperation, emitFailureHandler); + return Mono.empty(); + }); + + if (KafkaCosmosExceptionsHelper.isTimeoutException(exception)) { + Duration delayDuration = Duration.ofMillis( + MIN_DELAY_ON_408_REQUEST_TIMEOUT_IN_MS + + RANDOM.nextInt(MAX_DELAY_ON_408_REQUEST_TIMEOUT_IN_MS - MIN_DELAY_ON_408_REQUEST_TIMEOUT_IN_MS)); + + return retryMono.delaySubscription(delayDuration); + } + + return retryMono; + } + + BulkOperationFailedException handleErrorStatusCode( + CosmosBulkItemResponse itemResponse, + Exception exception, + SinkOperation sinkOperationContext) { + + int effectiveStatusCode = + itemResponse != null + ? itemResponse.getStatusCode() + : (exception != null && exception instanceof CosmosException ? ((CosmosException) exception).getStatusCode() : HttpConstants.StatusCodes.REQUEST_TIMEOUT); + int effectiveSubStatusCode = + itemResponse != null + ? itemResponse.getSubStatusCode() + : (exception != null && exception instanceof CosmosException ? ((CosmosException) exception).getSubStatusCode() : 0); + + String errorMessage = + String.format( + "Request failed with effectiveStatusCode: {%s}, effectiveSubStatusCode: {%s}, kafkaOffset: {%s}, kafkaPartition: {%s}, topic: {%s}", + effectiveStatusCode, + effectiveSubStatusCode, + sinkOperationContext.getKafkaOffset(), + sinkOperationContext.getKafkaPartition(), + sinkOperationContext.getTopic()); + + + return new BulkOperationFailedException(effectiveStatusCode, effectiveSubStatusCode, errorMessage, exception); + } + + private boolean shouldIgnore(BulkOperationFailedException failedException) { + switch (this.writeConfig.getItemWriteStrategy()) { + case ITEM_APPEND: + return KafkaCosmosExceptionsHelper.isResourceExistsException(failedException); + case ITEM_DELETE: + return KafkaCosmosExceptionsHelper.isNotFoundException(failedException); + case ITEM_DELETE_IF_NOT_MODIFIED: + return KafkaCosmosExceptionsHelper.isNotFoundException(failedException) + || KafkaCosmosExceptionsHelper.isPreconditionFailedException(failedException); + case ITEM_OVERWRITE_IF_NOT_MODIFIED: + return KafkaCosmosExceptionsHelper.isResourceExistsException(failedException) + || KafkaCosmosExceptionsHelper.isNotFoundException(failedException) + || KafkaCosmosExceptionsHelper.isPreconditionFailedException(failedException); + default: + return false; + } + } + + private void completeSinkOperation(SinkOperation sinkOperationContext, Runnable onCompleteRunnable) { + sinkOperationContext.complete(); + onCompleteRunnable.run(); + } + + public void completeSinkOperationWithFailure( + SinkOperation sinkOperationContext, + Exception exception, + Runnable onCompleteRunnable) { + + sinkOperationContext.setException(exception); + sinkOperationContext.complete(); + onCompleteRunnable.run(); + + this.sendToDlqIfConfigured(sinkOperationContext); + } + + private static class BulkOperationFailedException extends CosmosException { + protected BulkOperationFailedException(int statusCode, int subStatusCode, String message, Throwable cause) { + super(statusCode, message, null, cause); + BridgeInternal.setSubStatusCode(this, subStatusCode); + } + } + + private static class KafkaCosmosEmitFailureHandler implements Sinks.EmitFailureHandler { + + @Override + public boolean onEmitFailure(SignalType signalType, Sinks.EmitResult emitResult) { + if (emitResult.equals(Sinks.EmitResult.FAIL_NON_SERIALIZED)) { + LOGGER.debug("emitFailureHandler - Signal: {}, Result: {}", signalType, emitResult.toString()); + return true; + } else { + LOGGER.error("emitFailureHandler - Signal: {}, Result: {}", signalType, emitResult.toString()); + return false; + } + } + } +} + diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/KafkaCosmosPointWriter.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/KafkaCosmosPointWriter.java new file mode 100644 index 0000000000000..ea18cd5c7e9ec --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/KafkaCosmosPointWriter.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink; + +import com.azure.cosmos.CosmosAsyncContainer; +import com.azure.cosmos.implementation.ImplementationBridgeHelpers; +import com.azure.cosmos.implementation.apachecommons.lang.StringUtils; +import com.azure.cosmos.implementation.guava25.base.Function; +import com.azure.cosmos.kafka.connect.implementation.KafkaCosmosExceptionsHelper; +import com.azure.cosmos.kafka.connect.implementation.KafkaCosmosSchedulers; +import com.azure.cosmos.models.CosmosItemRequestOptions; +import org.apache.kafka.connect.sink.ErrantRecordReporter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import reactor.core.publisher.Mono; + +import java.util.List; + +import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkNotNull; + +public class KafkaCosmosPointWriter extends KafkaCosmosWriterBase { + private static final Logger LOGGER = LoggerFactory.getLogger(KafkaCosmosPointWriter.class); + + private final CosmosSinkWriteConfig writeConfig; + + public KafkaCosmosPointWriter( + CosmosSinkWriteConfig writeConfig, + ErrantRecordReporter errantRecordReporter) { + super(errantRecordReporter); + checkNotNull(writeConfig, "Argument 'writeConfig' can not be null"); + this.writeConfig = writeConfig; + } + + @Override + public void writeCore(CosmosAsyncContainer container, List sinkOperations) { + for (SinkOperation sinkOperation : sinkOperations) { + switch (this.writeConfig.getItemWriteStrategy()) { + case ITEM_OVERWRITE: + this.upsertWithRetry(container, sinkOperation); + break; + case ITEM_OVERWRITE_IF_NOT_MODIFIED: + String etag = this.getEtag(sinkOperation.getSinkRecord().value()); + if (StringUtils.isNotEmpty(etag)) { + this.replaceIfNotModifiedWithRetry(container, sinkOperation, etag); + } else { + this.createWithRetry(container, sinkOperation); + } + break; + case ITEM_APPEND: + this.createWithRetry(container, sinkOperation); + break; + case ITEM_DELETE: + this.deleteWithRetry(container, sinkOperation, false); + break; + case ITEM_DELETE_IF_NOT_MODIFIED: + this.deleteWithRetry(container, sinkOperation, true); + break; + default: + throw new IllegalArgumentException(this.writeConfig.getItemWriteStrategy() + " is not supported"); + } + } + } + + private void upsertWithRetry(CosmosAsyncContainer container, SinkOperation sinkOperation) { + executeWithRetry( + (operation) -> container.upsertItem(operation.getSinkRecord().value()).then(), + (throwable) -> false, // no exceptions should be ignored + sinkOperation + ); + } + + private void createWithRetry(CosmosAsyncContainer container, SinkOperation sinkOperation) { + executeWithRetry( + (operation) -> container.createItem(operation.getSinkRecord().value()).then(), + (throwable) -> KafkaCosmosExceptionsHelper.isResourceExistsException(throwable), + sinkOperation + ); + } + + private void replaceIfNotModifiedWithRetry(CosmosAsyncContainer container, SinkOperation sinkOperation, String etag) { + executeWithRetry( + (operation) -> { + CosmosItemRequestOptions itemRequestOptions = new CosmosItemRequestOptions(); + itemRequestOptions.setIfMatchETag(etag); + + return ImplementationBridgeHelpers + .CosmosAsyncContainerHelper + .getCosmosAsyncContainerAccessor() + .getPartitionKeyDefinition(container) + .flatMap(partitionKeyDefinition -> { + return container.replaceItem( + operation.getSinkRecord().value(), + getId(operation.getSinkRecord().value()), + getPartitionKeyValue(operation.getSinkRecord().value(), partitionKeyDefinition), + itemRequestOptions).then(); + }); + }, + (throwable) -> { + return KafkaCosmosExceptionsHelper.isNotFoundException(throwable) + || KafkaCosmosExceptionsHelper.isPreconditionFailedException(throwable); + }, + sinkOperation + ); + } + + private void deleteWithRetry(CosmosAsyncContainer container, SinkOperation sinkOperation, boolean onlyIfModified) { + executeWithRetry( + (operation) -> { + CosmosItemRequestOptions itemRequestOptions = new CosmosItemRequestOptions(); + if (onlyIfModified) { + String etag = this.getEtag(operation.getSinkRecord().value()); + if (StringUtils.isNotEmpty(etag)) { + itemRequestOptions.setIfMatchETag(etag); + } + } + + return ImplementationBridgeHelpers + .CosmosAsyncContainerHelper + .getCosmosAsyncContainerAccessor() + .getPartitionKeyDefinition(container) + .flatMap(partitionKeyDefinition -> { + return container.deleteItem( + getId(operation.getSinkRecord().value()), + getPartitionKeyValue(operation.getSinkRecord().value(), partitionKeyDefinition), + itemRequestOptions + ); + }).then(); + }, + (throwable) -> { + return KafkaCosmosExceptionsHelper.isNotFoundException(throwable) + || KafkaCosmosExceptionsHelper.isPreconditionFailedException(throwable); + }, + sinkOperation + ); + } + + private void executeWithRetry( + Function> execution, + Function shouldIgnoreFunc, + SinkOperation sinkOperation) { + + Mono.just(this) + .flatMap(data -> { + if (sinkOperation.getRetryCount() > 0) { + LOGGER.debug("Retry for sinkRecord {}", sinkOperation.getSinkRecord().key()); + } + return execution.apply(sinkOperation); + }) + .doOnSuccess(response -> sinkOperation.complete()) + .onErrorResume(throwable -> { + if (shouldIgnoreFunc.apply(throwable)) { + sinkOperation.complete(); + return Mono.empty(); + } + + if (shouldRetry(throwable, sinkOperation.getRetryCount(), this.writeConfig.getMaxRetryCount())) { + sinkOperation.setException(throwable); + sinkOperation.retry(); + + return Mono.empty(); + } else { + // request failed after exhausted all retries + this.sendToDlqIfConfigured(sinkOperation); + + sinkOperation.setException(throwable); + sinkOperation.complete(); + + if (this.writeConfig.getToleranceOnErrorLevel() == ToleranceOnErrorLevel.ALL) { + LOGGER.warn( + "Could not upload record {} to CosmosDB after exhausting all retries, but ToleranceOnErrorLevel is all, will only log the error message. ", + sinkOperation.getSinkRecord().key(), + sinkOperation.getException()); + return Mono.empty(); + } else { + return Mono.error(sinkOperation.getException()); + } + } + }) + .repeat(() -> !sinkOperation.isCompleted()) + .then() + .subscribeOn(KafkaCosmosSchedulers.SINK_BOUNDED_ELASTIC) + .block(); + } +} + diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/KafkaCosmosWriterBase.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/KafkaCosmosWriterBase.java new file mode 100644 index 0000000000000..c4633cc2df60a --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/KafkaCosmosWriterBase.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink; + +import com.azure.cosmos.CosmosAsyncContainer; +import com.azure.cosmos.implementation.ImplementationBridgeHelpers; +import com.azure.cosmos.implementation.Strings; +import com.azure.cosmos.implementation.apachecommons.lang.StringUtils; +import com.azure.cosmos.kafka.connect.implementation.KafkaCosmosExceptionsHelper; +import com.azure.cosmos.models.PartitionKey; +import com.azure.cosmos.models.PartitionKeyDefinition; +import org.apache.kafka.connect.sink.ErrantRecordReporter; +import org.apache.kafka.connect.sink.SinkRecord; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import static com.azure.cosmos.implementation.guava25.base.Preconditions.checkArgument; + +public abstract class KafkaCosmosWriterBase implements IWriter { + private static final Logger LOGGER = LoggerFactory.getLogger(KafkaCosmosWriterBase.class); + private static final String ID = "id"; + private static final String ETAG = "_etag"; + private final ErrantRecordReporter errantRecordReporter; + + public KafkaCosmosWriterBase(ErrantRecordReporter errantRecordReporter) { + this.errantRecordReporter = errantRecordReporter; + } + + abstract void writeCore(CosmosAsyncContainer container, List sinkOperations); + + @Override + public void write(CosmosAsyncContainer container, List sinkRecords) { + if (sinkRecords == null || sinkRecords.isEmpty()) { + LOGGER.debug("No records to be written to container {}", container.getId()); + return; + } + LOGGER.debug("Write {} records to container {}", sinkRecords.size(), container.getId()); + + // For each sinkRecord, it has a 1:1 mapping SinkOperation which contains sinkRecord and related context: retryCount, succeeded or failure. + List sinkOperations = + sinkRecords + .stream() + .map(sinkRecord -> new SinkOperation(sinkRecord)) + .collect(Collectors.toList()); + + try { + writeCore(container, sinkOperations); + } catch (Exception e) { + LOGGER.error("Write failed. ", e); + throw new CosmosWriteException(e.getMessage()); + } + } + + @SuppressWarnings("unchecked") + protected String getId(Object recordValue) { + checkArgument(recordValue instanceof Map, "Argument 'recordValue' is not valid map format."); + return ((Map) recordValue).get(ID).toString(); + } + + @SuppressWarnings("unchecked") + protected String getEtag(Object recordValue) { + checkArgument(recordValue instanceof Map, "Argument 'recordValue' is not valid map format."); + return ((Map) recordValue).getOrDefault(ETAG, Strings.Emtpy).toString(); + } + + @SuppressWarnings("unchecked") + protected PartitionKey getPartitionKeyValue(Object recordValue, PartitionKeyDefinition partitionKeyDefinition) { + checkArgument(recordValue instanceof Map, "Argument 'recordValue' is not valid map format."); + + //TODO[Public Preview]: add support for sub-partition + String partitionKeyPath = StringUtils.join(partitionKeyDefinition.getPaths(), ""); + Map recordMap = (Map) recordValue; + Object partitionKeyValue = recordMap.get(partitionKeyPath.substring(1)); + + return ImplementationBridgeHelpers + .PartitionKeyHelper + .getPartitionKeyAccessor() + .toPartitionKey(Collections.singletonList(partitionKeyValue), false); + } + + protected boolean shouldRetry(Throwable exception, int attemptedCount, int maxRetryCount) { + if (attemptedCount >= maxRetryCount) { + return false; + } + + return KafkaCosmosExceptionsHelper.isTransientFailure(exception); + } + + protected void sendToDlqIfConfigured(SinkOperation sinkOperationContext) { + if (this.errantRecordReporter != null) { + errantRecordReporter.report(sinkOperationContext.getSinkRecord(), sinkOperationContext.getException()); + } + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/SinkOperation.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/SinkOperation.java new file mode 100644 index 0000000000000..599a71ec99848 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/SinkOperation.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink; + +import org.apache.kafka.connect.sink.SinkRecord; + +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; + +public class SinkOperation { + private final SinkRecord sinkRecord; + private final AtomicInteger retryCount; + private final AtomicReference exception; + private final AtomicBoolean completed; + + public SinkOperation(SinkRecord sinkRecord) { + this.sinkRecord = sinkRecord; + this.retryCount = new AtomicInteger(0); + this.exception = new AtomicReference<>(null); + this.completed = new AtomicBoolean(false); + } + + public SinkRecord getSinkRecord() { + return this.sinkRecord; + } + + public long getKafkaOffset() { + return this.sinkRecord.kafkaOffset(); + } + + public Integer getKafkaPartition() { + return this.sinkRecord.kafkaPartition(); + } + + public String getTopic() { + return this.sinkRecord.topic(); + } + + public int getRetryCount() { + return this.retryCount.get(); + } + + public void retry() { + this.retryCount.incrementAndGet(); + } + + public Throwable getException() { + return this.exception.get(); + } + + public void setException(Throwable exception) { + this.exception.set(exception); + } + + public boolean isCompleted() { + return this.completed.get(); + } + + public void complete() { + this.completed.set(true); + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/SinkRecordTransformer.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/SinkRecordTransformer.java new file mode 100644 index 0000000000000..007d09bb793d7 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/SinkRecordTransformer.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink; + +import com.azure.cosmos.kafka.connect.implementation.sink.idstrategy.AbstractIdStrategyConfig; +import com.azure.cosmos.kafka.connect.implementation.sink.idstrategy.FullKeyStrategy; +import com.azure.cosmos.kafka.connect.implementation.sink.idstrategy.IdStrategy; +import com.azure.cosmos.kafka.connect.implementation.sink.idstrategy.KafkaMetadataStrategy; +import com.azure.cosmos.kafka.connect.implementation.sink.idstrategy.ProvidedInKeyStrategy; +import com.azure.cosmos.kafka.connect.implementation.sink.idstrategy.ProvidedInValueStrategy; +import com.azure.cosmos.kafka.connect.implementation.sink.idstrategy.TemplateStrategy; +import org.apache.kafka.connect.data.Struct; +import org.apache.kafka.connect.sink.SinkRecord; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.slf4j.MDC; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class SinkRecordTransformer { + private static final Logger LOGGER = LoggerFactory.getLogger(SinkRecordTransformer.class); + + private final IdStrategy idStrategy; + + public SinkRecordTransformer(CosmosSinkTaskConfig sinkTaskConfig) { + this.idStrategy = this.createIdStrategy(sinkTaskConfig); + } + + @SuppressWarnings("unchecked") + public List transform(String containerName, List sinkRecords) { + List toBeWrittenRecordList = new ArrayList<>(); + for (SinkRecord record : sinkRecords) { + if (record.key() != null) { + MDC.put(String.format("CosmosDbSink-%s", containerName), record.key().toString()); + } + + LOGGER.trace( + "Key Schema [{}], Key [{}], Value type [{}], Value schema [{}]", + record.keySchema(), + record.key(), + record.value() == null ? null : record.value().getClass().getName(), + record.value() == null ? null : record.valueSchema()); + + Object recordValue; + if (record.value() instanceof Struct) { + recordValue = StructToJsonMap.toJsonMap((Struct) record.value()); + } else if (record.value() instanceof Map) { + recordValue = StructToJsonMap.handleMap((Map) record.value()); + } else { + recordValue = record.value(); + } + + maybeInsertId(recordValue, record); + + // Create an updated record with from the current record and the updated record value + final SinkRecord updatedRecord = new SinkRecord(record.topic(), + record.kafkaPartition(), + record.keySchema(), + record.key(), + record.valueSchema(), + recordValue, + record.kafkaOffset(), + record.timestamp(), + record.timestampType(), + record.headers()); + + toBeWrittenRecordList.add(updatedRecord); + } + + return toBeWrittenRecordList; + } + + @SuppressWarnings("unchecked") + private void maybeInsertId(Object recordValue, SinkRecord sinkRecord) { + if (!(recordValue instanceof Map)) { + return; + } + Map recordMap = (Map) recordValue; + recordMap.put(AbstractIdStrategyConfig.ID, this.idStrategy.generateId(sinkRecord)); + } + + private IdStrategy createIdStrategy(CosmosSinkTaskConfig sinkTaskConfig) { + IdStrategy idStrategyClass; + switch (sinkTaskConfig.getIdStrategy()) { + case FULL_KEY_STRATEGY: + idStrategyClass = new FullKeyStrategy(); + break; + case TEMPLATE_STRATEGY: + idStrategyClass = new TemplateStrategy(); + break; + case KAFKA_METADATA_STRATEGY: + idStrategyClass = new KafkaMetadataStrategy(); + break; + case PROVIDED_IN_VALUE_STRATEGY: + idStrategyClass = new ProvidedInValueStrategy(); + break; + case PROVIDED_IN_KEY_STRATEGY: + idStrategyClass = new ProvidedInKeyStrategy(); + break; + default: + throw new IllegalArgumentException(sinkTaskConfig.getIdStrategy() + " is not supported"); + } + + idStrategyClass.configure(sinkTaskConfig.originalsWithPrefix(AbstractIdStrategyConfig.PREFIX)); + return idStrategyClass; + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/StructToJsonMap.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/StructToJsonMap.java new file mode 100644 index 0000000000000..388baa3778f8d --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/StructToJsonMap.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink; + +import org.apache.kafka.connect.data.Date; +import org.apache.kafka.connect.data.Field; +import org.apache.kafka.connect.data.Schema; +import org.apache.kafka.connect.data.Struct; +import org.apache.kafka.connect.data.Time; +import org.apache.kafka.connect.data.Timestamp; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +// TODO[Public Preview]: Double check logic here, copied over from V1 +public class StructToJsonMap { + + public static Map toJsonMap(Struct struct) { + if (struct == null) { + return null; + } + Map jsonMap = new HashMap(0); + List fields = struct.schema().fields(); + for (Field field : fields) { + String fieldName = field.name(); + Schema.Type fieldType = field.schema().type(); + String schemaName = field.schema().name(); + switch (fieldType) { + case STRING: + jsonMap.put(fieldName, struct.getString(fieldName)); + break; + case INT32: + if (Date.LOGICAL_NAME.equals(schemaName) || Time.LOGICAL_NAME.equals(schemaName)) { + jsonMap.put(fieldName, (java.util.Date) struct.get(fieldName)); + } else { + jsonMap.put(fieldName, struct.getInt32(fieldName)); + } + break; + case INT16: + jsonMap.put(fieldName, struct.getInt16(fieldName)); + break; + case INT64: + if (Timestamp.LOGICAL_NAME.equals(schemaName)) { + jsonMap.put(fieldName, (java.util.Date) struct.get(fieldName)); + } else { + jsonMap.put(fieldName, struct.getInt64(fieldName)); + } + break; + case FLOAT32: + jsonMap.put(fieldName, struct.getFloat32(fieldName)); + break; + case FLOAT64: + jsonMap.put(fieldName, struct.getFloat64(fieldName)); + break; + case BOOLEAN: + jsonMap.put(fieldName, struct.getBoolean(fieldName)); + break; + case ARRAY: + List fieldArray = struct.getArray(fieldName); + if (fieldArray != null && !fieldArray.isEmpty() && fieldArray.get(0) instanceof Struct) { + // If Array contains list of Structs + List jsonArray = new ArrayList<>(); + fieldArray.forEach(item -> { + jsonArray.add(toJsonMap((Struct) item)); + }); + jsonMap.put(fieldName, jsonArray); + } else { + jsonMap.put(fieldName, fieldArray); + } + break; + case STRUCT: + jsonMap.put(fieldName, toJsonMap(struct.getStruct(fieldName))); + break; + case MAP: + jsonMap.put(fieldName, handleMap(struct.getMap(fieldName))); + break; + default: + jsonMap.put(fieldName, struct.get(fieldName)); + break; + } + } + return jsonMap; + } + + @SuppressWarnings("unchecked") + public static Map handleMap(Map map) { + if (map == null) { + return null; + } + Map cacheMap = new HashMap<>(); + map.forEach((key, value) -> { + if (value instanceof Map) { + cacheMap.put(key, handleMap((Map) value)); + } else if (value instanceof Struct) { + cacheMap.put(key, toJsonMap((Struct) value)); + } else if (value instanceof List) { + List list = (List) value; + List jsonArray = new ArrayList<>(); + list.forEach(item -> { + if (item instanceof Struct) { + jsonArray.add(toJsonMap((Struct) item)); + } else if (item instanceof Map) { + jsonArray.add(handleMap((Map) item)); + } else { + jsonArray.add(item); + } + }); + cacheMap.put(key, jsonArray); + } else { + cacheMap.put(key, value); + } + }); + return cacheMap; + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/ToleranceOnErrorLevel.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/ToleranceOnErrorLevel.java new file mode 100644 index 0000000000000..d169fd2484b0a --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/ToleranceOnErrorLevel.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink; + +public enum ToleranceOnErrorLevel { + NONE("None"), + ALL("All"); + + private final String name; + + ToleranceOnErrorLevel(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public static ToleranceOnErrorLevel fromName(String name) { + for (ToleranceOnErrorLevel mode : ToleranceOnErrorLevel.values()) { + if (mode.getName().equalsIgnoreCase(name)) { + return mode; + } + } + return null; + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/AbstractIdStrategy.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/AbstractIdStrategy.java new file mode 100644 index 0000000000000..41bc401b81360 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/AbstractIdStrategy.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink.idstrategy; + +import java.util.Map; +import java.util.regex.Pattern; + +public abstract class AbstractIdStrategy implements IdStrategy { + private static final String SANITIZED_CHAR = "_"; + private static final Pattern SANITIZE_ID_PATTERN = Pattern.compile("[/\\\\?#]"); + + protected Map configs; + + @Override + public void configure(Map configs) { + this.configs = configs; + } + + /** + * Replaces all characters that cannot be part of the ID with {@value SANITIZED_CHAR}. + *

The following characters are restricted and cannot be used in the Id property: '/', '\\', '?', '#' + */ + public static String sanitizeId(String unsanitized) { + return SANITIZE_ID_PATTERN.matcher(unsanitized).replaceAll(SANITIZED_CHAR); + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/AbstractIdStrategyConfig.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/AbstractIdStrategyConfig.java new file mode 100644 index 0000000000000..1713ecc79636e --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/AbstractIdStrategyConfig.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink.idstrategy; + +import org.apache.kafka.common.config.AbstractConfig; +import org.apache.kafka.common.config.ConfigDef; + +import java.util.Map; + +public class AbstractIdStrategyConfig extends AbstractConfig { + public static final String ID = "id"; + public static final String ID_STRATEGY = ID + ".strategy"; + public static final String PREFIX = ID_STRATEGY + "."; + + public AbstractIdStrategyConfig(ConfigDef definition, Map originals) { + super(definition, originals); + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/FullKeyStrategy.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/FullKeyStrategy.java new file mode 100644 index 0000000000000..62fc6f72a3406 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/FullKeyStrategy.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink.idstrategy; + +import java.util.HashMap; +import java.util.Map; + +public class FullKeyStrategy extends TemplateStrategy { + @Override + public void configure(Map configs) { + Map conf = new HashMap<>(configs); + conf.put(TemplateStrategyConfig.TEMPLATE_CONFIG, "${key}"); + super.configure(conf); + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/IdStrategy.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/IdStrategy.java new file mode 100644 index 0000000000000..b4ce03d4f73e3 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/IdStrategy.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink.idstrategy; + +import org.apache.kafka.common.Configurable; +import org.apache.kafka.connect.sink.SinkRecord; + +public interface IdStrategy extends Configurable { + String generateId(SinkRecord record); +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/KafkaMetadataStrategy.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/KafkaMetadataStrategy.java new file mode 100644 index 0000000000000..99d705f062f4c --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/KafkaMetadataStrategy.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink.idstrategy; + +import java.util.HashMap; +import java.util.Map; + +public class KafkaMetadataStrategy extends TemplateStrategy { + private KafkaMetadataStrategyConfig config; + + @Override + public void configure(Map configs) { + config = new KafkaMetadataStrategyConfig(configs); + Map conf = new HashMap<>(configs); + conf.put(TemplateStrategyConfig.TEMPLATE_CONFIG, + "${topic}" + config.delimiter() + + "${partition}" + config.delimiter() + "${offset}"); + + super.configure(conf); + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/KafkaMetadataStrategyConfig.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/KafkaMetadataStrategyConfig.java new file mode 100644 index 0000000000000..b29d59e4409ca --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/KafkaMetadataStrategyConfig.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink.idstrategy; + +import org.apache.kafka.common.config.ConfigDef; + +import java.util.Map; + +public class KafkaMetadataStrategyConfig extends AbstractIdStrategyConfig { + public static final String DELIMITER_CONFIG = "delimiter"; + public static final String DELIMITER_CONFIG_DEFAULT = "-"; + public static final String DELIMITER_CONFIG_DOC = "The delimiter between metadata components"; + public static final String DELIMITER_CONFIG_DISPLAY = "Kafka Metadata"; + + private String delimiter; + + public KafkaMetadataStrategyConfig(Map props) { + this(getConfig(), props); + } + + public KafkaMetadataStrategyConfig(ConfigDef definition, Map originals) { + super(definition, originals); + + this.delimiter = getString(DELIMITER_CONFIG); + } + + public static ConfigDef getConfig() { + ConfigDef result = new ConfigDef(); + + final String groupName = "Kafka Metadata Parameters"; + int groupOrder = 0; + + result.define( + DELIMITER_CONFIG, + ConfigDef.Type.STRING, + DELIMITER_CONFIG_DEFAULT, + ConfigDef.Importance.MEDIUM, + DELIMITER_CONFIG_DOC, + groupName, + groupOrder++, + ConfigDef.Width.MEDIUM, + DELIMITER_CONFIG_DISPLAY + ); + + return result; + } + + public String delimiter() { + return delimiter; + } +} + diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/ProvidedInConfig.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/ProvidedInConfig.java new file mode 100644 index 0000000000000..de3892baa1d2e --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/ProvidedInConfig.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink.idstrategy; + +import org.apache.kafka.common.config.ConfigDef; + +import java.util.Map; + +public class ProvidedInConfig extends AbstractIdStrategyConfig { + public static final String JSON_PATH_CONFIG = "jsonPath"; + public static final String JSON_PATH_CONFIG_DEFAULT = "$.id"; + public static final String JSON_PATH_CONFIG_DOC = "A JsonPath expression to select the desired component to use as ``id``"; + public static final String JSON_PATH_CONFIG_DISPLAY = "JSON Path"; + private final String jsonPath; + + public ProvidedInConfig(Map props) { + this(getConfig(), props); + } + + public ProvidedInConfig(ConfigDef definition, Map originals) { + super(definition, originals); + + this.jsonPath = getString(JSON_PATH_CONFIG); + } + + + public static ConfigDef getConfig() { + ConfigDef result = new ConfigDef(); + + final String groupName = "JsonPath Parameters"; + int groupOrder = 0; + + result.define( + JSON_PATH_CONFIG, + ConfigDef.Type.STRING, + JSON_PATH_CONFIG_DEFAULT, + ConfigDef.Importance.MEDIUM, + JSON_PATH_CONFIG_DOC, + groupName, + groupOrder++, + ConfigDef.Width.MEDIUM, + JSON_PATH_CONFIG_DISPLAY + ); + + return result; + } + + public String jsonPath() { + return jsonPath; + } +} + diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/ProvidedInKeyStrategy.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/ProvidedInKeyStrategy.java new file mode 100644 index 0000000000000..930e2435351e8 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/ProvidedInKeyStrategy.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink.idstrategy; + +public class ProvidedInKeyStrategy extends ProvidedInStrategy { + public ProvidedInKeyStrategy() { + super(ProvidedIn.KEY); + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/ProvidedInStrategy.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/ProvidedInStrategy.java new file mode 100644 index 0000000000000..79b4ed19f655d --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/ProvidedInStrategy.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink.idstrategy; + +import org.apache.kafka.connect.data.Values; +import org.apache.kafka.connect.errors.ConnectException; +import org.apache.kafka.connect.sink.SinkRecord; +import com.jayway.jsonpath.JsonPath; + +import java.util.Map; + +class ProvidedInStrategy extends AbstractIdStrategy { + protected enum ProvidedIn { + KEY, + VALUE + } + + private final ProvidedIn where; + + private ProvidedInConfig config; + + ProvidedInStrategy(ProvidedIn where) { + this.where = where; + } + + @Override + public String generateId(SinkRecord record) { + String value = where == ProvidedIn.KEY + ? Values.convertToString(record.keySchema(), record.key()) + : Values.convertToString(record.valueSchema(), record.value()); + try { + Object object = JsonPath.parse(value).read(config.jsonPath()); + return sanitizeId(Values.convertToString(null, object)); + } catch (Exception e) { + throw new ConnectException("Could not evaluate JsonPath " + config.jsonPath(), e); + } + } + + @Override + public void configure(Map configs) { + config = new ProvidedInConfig(configs); + super.configure(configs); + } +} + diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/ProvidedInValueStrategy.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/ProvidedInValueStrategy.java new file mode 100644 index 0000000000000..ca5b794fc8bd8 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/ProvidedInValueStrategy.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink.idstrategy; + +public class ProvidedInValueStrategy extends ProvidedInStrategy { + public ProvidedInValueStrategy() { + super(ProvidedIn.VALUE); + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/TemplateStrategy.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/TemplateStrategy.java new file mode 100644 index 0000000000000..1f40827050dcc --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/TemplateStrategy.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink.idstrategy; + +import com.azure.cosmos.implementation.guava25.collect.ImmutableMap; +import org.apache.kafka.connect.data.Values; +import org.apache.kafka.connect.sink.SinkRecord; + +import java.util.Map; +import java.util.function.Function; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +public class TemplateStrategy extends AbstractIdStrategy { + private static final String KEY = "key"; + private static final String TOPIC = "topic"; + private static final String PARTITION = "partition"; + private static final String OFFSET = "offset"; + + private static final String PATTERN_TEMPLATE = "\\$\\{(%s)\\}"; + private static final Pattern PATTERN; + + private TemplateStrategyConfig config; + + private static final Map> METHODS_BY_VARIABLE; + + static { + ImmutableMap.Builder> builder = ImmutableMap.builder(); + builder.put(KEY, (r) -> Values.convertToString(r.keySchema(), r.key())); + builder.put(TOPIC, SinkRecord::topic); + builder.put(PARTITION, (r) -> r.kafkaPartition().toString()); + builder.put(OFFSET, (r) -> Long.toString(r.kafkaOffset())); + METHODS_BY_VARIABLE = builder.build(); + + String pattern = String.format(PATTERN_TEMPLATE, + METHODS_BY_VARIABLE.keySet().stream().collect(Collectors.joining("|"))); + PATTERN = Pattern.compile(pattern); + } + + @Override + public String generateId(SinkRecord record) { + String template = config.template(); + return sanitizeId(resolveAll(template, record)); + } + + @Override + public void configure(Map configs) { + config = new TemplateStrategyConfig(configs); + + super.configure(configs); + } + + private String resolveAll(String template, SinkRecord record) { + int lastIndex = 0; + StringBuilder output = new StringBuilder(); + Matcher matcher = PATTERN.matcher(template); + while (matcher.find()) { + output.append(template, lastIndex, matcher.start()) + .append(METHODS_BY_VARIABLE.get(matcher.group(1)).apply(record)); + + lastIndex = matcher.end(); + } + if (lastIndex < template.length()) { + output.append(template, lastIndex, template.length()); + } + return output.toString(); + } +} + diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/TemplateStrategyConfig.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/TemplateStrategyConfig.java new file mode 100644 index 0000000000000..c03c605438d9b --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/sink/idstrategy/TemplateStrategyConfig.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink.idstrategy; + +import org.apache.kafka.common.config.ConfigDef; + +import java.util.Map; + +public class TemplateStrategyConfig extends AbstractIdStrategyConfig { + public static final String TEMPLATE_CONFIG = "template"; + public static final String TEMPLATE_CONFIG_DEFAULT = ""; + public static final String TEMPLATE_CONFIG_DOC = + "The template string to use for determining the ``id``. The template can contain the " + + "following variables that are bound to their values on the Kafka record:" + + "${topic}, ${partition}, ${offset}, ${key}. For example, the template " + + "``${topic}-${key}`` would use the topic name and the entire key in the ``id``, " + + "separated by '-'"; + public static final String TEMPLATE_CONFIG_DISPLAY = "Template"; + private final String template; + + public TemplateStrategyConfig(Map props) { + this(getConfig(), props); + } + + public TemplateStrategyConfig(ConfigDef definition, Map originals) { + super(definition, originals); + + this.template = getString(TEMPLATE_CONFIG); + } + + public static ConfigDef getConfig() { + ConfigDef result = new ConfigDef(); + + final String groupName = "Template Parameters"; + int groupOrder = 0; + + result.define( + TEMPLATE_CONFIG, + ConfigDef.Type.STRING, + TEMPLATE_CONFIG_DEFAULT, + ConfigDef.Importance.MEDIUM, + TEMPLATE_CONFIG_DOC, + groupName, + groupOrder++, + ConfigDef.Width.MEDIUM, + TEMPLATE_CONFIG_DISPLAY + ); + + return result; + } + + public String template() { + return template; + } +} + diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/source/MetadataMonitorThread.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/source/MetadataMonitorThread.java index 49901acbfbf07..4aadf980dc60a 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/source/MetadataMonitorThread.java +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/source/MetadataMonitorThread.java @@ -6,7 +6,7 @@ import com.azure.cosmos.CosmosAsyncClient; import com.azure.cosmos.CosmosAsyncContainer; import com.azure.cosmos.implementation.ImplementationBridgeHelpers; -import com.azure.cosmos.kafka.connect.implementation.CosmosExceptionsHelper; +import com.azure.cosmos.kafka.connect.implementation.KafkaCosmosExceptionsHelper; import com.azure.cosmos.models.CosmosContainerProperties; import com.azure.cosmos.models.FeedRange; import com.azure.cosmos.models.SqlParameter; @@ -136,7 +136,7 @@ public Mono> getAllContainers() { .byPage() .flatMapIterable(response -> response.getResults()) .collectList() - .onErrorMap(throwable -> CosmosExceptionsHelper.convertToConnectException(throwable, "getAllContainers failed.")); + .onErrorMap(throwable -> KafkaCosmosExceptionsHelper.convertToConnectException(throwable, "getAllContainers failed.")); } public List getContainerRidsFromOffset() { diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/module-info.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/module-info.java index 42f1d1d32a4fa..aa261ccdbf404 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/module-info.java +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/module-info.java @@ -8,6 +8,7 @@ requires kafka.clients; requires connect.api; requires com.fasterxml.jackson.module.afterburner; + requires json.path; // public API surface area exports com.azure.cosmos.kafka.connect; diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosSinkConnectorITest.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosSinkConnectorITest.java new file mode 100644 index 0000000000000..cfeb28f71d658 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosSinkConnectorITest.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect; + +import com.azure.cosmos.CosmosAsyncClient; +import com.azure.cosmos.CosmosAsyncContainer; +import com.azure.cosmos.implementation.Utils; +import com.azure.cosmos.kafka.connect.implementation.CosmosClientStore; +import com.azure.cosmos.kafka.connect.implementation.sink.CosmosSinkConfig; +import com.fasterxml.jackson.databind.JsonNode; +import org.apache.kafka.clients.producer.KafkaProducer; +import org.apache.kafka.clients.producer.ProducerRecord; +import org.apache.kafka.connect.json.JsonConverter; +import org.apache.kafka.connect.storage.StringConverter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.annotations.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; + +public class CosmosSinkConnectorITest extends KafkaCosmosIntegrationTestSuiteBase { + private static final Logger logger = LoggerFactory.getLogger(CosmosSinkConnectorITest.class); + + // TODO[public preview]: add more integration tests + @Test(groups = { "kafka-integration"}, timeOut = TIMEOUT) + public void sinkToSingleContainer() throws InterruptedException { + Map sinkConnectorConfig = new HashMap<>(); + + sinkConnectorConfig.put("topics", singlePartitionContainerName); + sinkConnectorConfig.put("value.converter", JsonConverter.class.getName()); + // TODO[Public Preview]: add tests for with schema + sinkConnectorConfig.put("value.converter.schemas.enable", "false"); + sinkConnectorConfig.put("key.converter", StringConverter.class.getName()); + sinkConnectorConfig.put("connector.class", "com.azure.cosmos.kafka.connect.CosmosSinkConnector"); + sinkConnectorConfig.put("kafka.connect.cosmos.accountEndpoint", KafkaCosmosTestConfigurations.HOST); + sinkConnectorConfig.put("kafka.connect.cosmos.accountKey", KafkaCosmosTestConfigurations.MASTER_KEY); + sinkConnectorConfig.put("kafka.connect.cosmos.applicationName", "Test"); + sinkConnectorConfig.put("kafka.connect.cosmos.sink.database.name", databaseName); + sinkConnectorConfig.put("kafka.connect.cosmos.sink.containers.topicMap", singlePartitionContainerName + "#" + singlePartitionContainerName); + + // Create topic ahead of time + kafkaCosmosConnectContainer.createTopic(singlePartitionContainerName, 1); + + CosmosSinkConfig sinkConfig = new CosmosSinkConfig(sinkConnectorConfig); + CosmosAsyncClient client = CosmosClientStore.getCosmosClient(sinkConfig.getAccountConfig()); + CosmosAsyncContainer container = client.getDatabase(databaseName).getContainer(singlePartitionContainerName); + + String connectorName = "simpleTest-" + UUID.randomUUID(); + try { + // register the sink connector + kafkaCosmosConnectContainer.registerConnector(connectorName, sinkConnectorConfig); + + KafkaProducer kafkaProducer = kafkaCosmosConnectContainer.getProducer(); + + // first create few records in the topic + logger.info("Creating sink records..."); + List recordValueIds = new ArrayList<>(); + for (int i = 0; i < 10; i++) { + TestItem testItem = TestItem.createNewItem(); + ProducerRecord record = + new ProducerRecord<>(singlePartitionContainerName, testItem.getId(), Utils.getSimpleObjectMapper().valueToTree(testItem)); + kafkaProducer.send(record); + recordValueIds.add(testItem.getId()); + } + + // Wait for some time for the sink connector to process all records + Thread.sleep(5000); + // read from the container and verify all the items are created + String query = "select * from c"; + List createdItemIds = container.queryItems(query, TestItem.class) + .byPage() + .flatMapIterable(response -> response.getResults()) + .map(TestItem::getId) + .collectList() + .block(); + assertThat(createdItemIds.size()).isEqualTo(recordValueIds.size()); + assertThat(createdItemIds.containsAll(recordValueIds)).isTrue(); + + } finally { + if (client != null) { + logger.info("cleaning container {}", singlePartitionContainerName); + cleanUpContainer(client, databaseName, singlePartitionContainerName); + client.close(); + } + + // IMPORTANT: remove the connector after use + if (kafkaCosmosConnectContainer != null) { + kafkaCosmosConnectContainer.deleteConnector(connectorName); + } + } + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosSinkConnectorTest.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosSinkConnectorTest.java new file mode 100644 index 0000000000000..a10f6beea1a41 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosSinkConnectorTest.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect; + +import com.azure.cosmos.implementation.Strings; +import com.azure.cosmos.kafka.connect.implementation.sink.CosmosSinkTask; +import com.azure.cosmos.kafka.connect.implementation.sink.IdStrategies; +import com.azure.cosmos.kafka.connect.implementation.sink.ItemWriteStrategy; +import org.apache.kafka.common.config.Config; +import org.apache.kafka.common.config.ConfigDef; +import org.apache.kafka.common.config.ConfigValue; +import org.testng.annotations.Test; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.stream.Collectors; + +import static com.azure.cosmos.kafka.connect.CosmosSinkConnectorTest.SinkConfigs.ALL_VALID_CONFIGS; +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; +import static org.testng.Assert.assertEquals; + +public class CosmosSinkConnectorTest extends KafkaCosmosTestSuiteBase { + @Test(groups = "unit") + public void taskClass() { + CosmosSinkConnector sinkConnector = new CosmosSinkConnector(); + assertEquals(sinkConnector.taskClass(), CosmosSinkTask.class); + } + + @Test(groups = "unit") + public void config() { + CosmosSinkConnector sinkConnector = new CosmosSinkConnector(); + ConfigDef configDef = sinkConnector.config(); + Map configs = configDef.configKeys(); + List> allValidConfigs = ALL_VALID_CONFIGS; + + for (KafkaCosmosConfigEntry sinkConfigEntry : allValidConfigs) { + assertThat(configs.containsKey(sinkConfigEntry.getName())).isTrue(); + + configs.containsKey(sinkConfigEntry.getName()); + if (sinkConfigEntry.isOptional()) { + assertThat(configs.get(sinkConfigEntry.getName()).defaultValue).isEqualTo(sinkConfigEntry.getDefaultValue()); + } else { + assertThat(configs.get(sinkConfigEntry.getName()).defaultValue).isEqualTo(ConfigDef.NO_DEFAULT_VALUE); + } + } + } + + @Test(groups = "unit") + public void requiredConfig() { + Config config = new CosmosSinkConnector().validate(Collections.emptyMap()); + Map> errorMessages = config.configValues().stream() + .collect(Collectors.toMap(ConfigValue::name, ConfigValue::errorMessages)); + assertThat(errorMessages.get("kafka.connect.cosmos.accountEndpoint").size()).isGreaterThan(0); + assertThat(errorMessages.get("kafka.connect.cosmos.accountKey").size()).isGreaterThan(0); + assertThat(errorMessages.get("kafka.connect.cosmos.sink.database.name").size()).isGreaterThan(0); + assertThat(errorMessages.get("kafka.connect.cosmos.sink.containers.topicMap").size()).isGreaterThan(0); + } + + @Test(groups = "unit") + public void taskConfigs() { + CosmosSinkConnector sinkConnector = new CosmosSinkConnector(); + + Map sinkConfigMap = new HashMap<>(); + sinkConfigMap.put("kafka.connect.cosmos.accountEndpoint", KafkaCosmosTestConfigurations.HOST); + sinkConfigMap.put("kafka.connect.cosmos.accountKey", KafkaCosmosTestConfigurations.MASTER_KEY); + sinkConfigMap.put("kafka.connect.cosmos.sink.database.name", databaseName); + sinkConfigMap.put("kafka.connect.cosmos.sink.containers.topicMap", singlePartitionContainerName + "#" + singlePartitionContainerName); + sinkConnector.start(sinkConfigMap); + + int maxTask = 2; + List> taskConfigs = sinkConnector.taskConfigs(maxTask); + assertThat(taskConfigs.size()).isEqualTo(maxTask); + + for (Map taskConfig : taskConfigs) { + assertThat(taskConfig.get("kafka.connect.cosmos.accountEndpoint")).isEqualTo(KafkaCosmosTestConfigurations.HOST); + assertThat(taskConfig.get("kafka.connect.cosmos.accountKey")).isEqualTo(KafkaCosmosTestConfigurations.MASTER_KEY); + assertThat(taskConfig.get("kafka.connect.cosmos.sink.database.name")).isEqualTo(databaseName); + assertThat(taskConfig.get("kafka.connect.cosmos.sink.containers.topicMap")) + .isEqualTo(singlePartitionContainerName + "#" + singlePartitionContainerName); + } + } + + @Test(groups = "unit") + public void misFormattedConfig() { + CosmosSinkConnector sinkConnector = new CosmosSinkConnector(); + Map sinkConfigMap = this.getValidSinkConfig(); + + String topicMapConfigName = "kafka.connect.cosmos.sink.containers.topicMap"; + sinkConfigMap.put(topicMapConfigName, UUID.randomUUID().toString()); + + Config validatedConfig = sinkConnector.validate(sinkConfigMap); + ConfigValue configValue = + validatedConfig + .configValues() + .stream() + .filter(config -> config.name().equalsIgnoreCase(topicMapConfigName)) + .findFirst() + .get(); + + assertThat(configValue.errorMessages()).isNotNull(); + assertThat( + configValue + .errorMessages() + .get(0) + .contains( + "The topic-container map should be a comma-delimited list of Kafka topic to Cosmos containers." + + " Each mapping should be a pair of Kafka topic and Cosmos container separated by '#'." + + " For example: topic1#con1,topic2#con2.")) + .isTrue(); + + // TODO[Public Preview]: add other config validations + } + + private Map getValidSinkConfig() { + Map sinkConfigMap = new HashMap<>(); + sinkConfigMap.put("kafka.connect.cosmos.accountEndpoint", KafkaCosmosTestConfigurations.HOST); + sinkConfigMap.put("kafka.connect.cosmos.accountKey", KafkaCosmosTestConfigurations.MASTER_KEY); + sinkConfigMap.put("kafka.connect.cosmos.sink.database.name", databaseName); + sinkConfigMap.put("kafka.connect.cosmos.sink.containers.topicMap", singlePartitionContainerName + "#" + singlePartitionContainerName); + + return sinkConfigMap; + } + + public static class SinkConfigs { + public static final List> ALL_VALID_CONFIGS = Arrays.asList( + new KafkaCosmosConfigEntry("kafka.connect.cosmos.accountEndpoint", null, false), + new KafkaCosmosConfigEntry("kafka.connect.cosmos.accountKey", null, false), + new KafkaCosmosConfigEntry("kafka.connect.cosmos.useGatewayMode", false, true), + new KafkaCosmosConfigEntry("kafka.connect.cosmos.preferredRegionsList", Strings.Emtpy, true), + new KafkaCosmosConfigEntry("kafka.connect.cosmos.applicationName", Strings.Emtpy, true), + new KafkaCosmosConfigEntry("kafka.connect.cosmos.sink.errors.tolerance", "None", true), + new KafkaCosmosConfigEntry("kafka.connect.cosmos.sink.bulk.enabled", true, true), + new KafkaCosmosConfigEntry("kafka.connect.cosmos.sink.bulk.maxConcurrentCosmosPartitions", -1, true), + new KafkaCosmosConfigEntry("kafka.connect.cosmos.sink.bulk.initialBatchSize", 1, true), + new KafkaCosmosConfigEntry( + "kafka.connect.cosmos.sink.write.strategy", + ItemWriteStrategy.ITEM_OVERWRITE.getName(), + true), + new KafkaCosmosConfigEntry("kafka.connect.cosmos.sink.maxRetryCount", 10, true), + new KafkaCosmosConfigEntry("kafka.connect.cosmos.sink.database.name", null, false), + new KafkaCosmosConfigEntry("kafka.connect.cosmos.sink.containers.topicMap", null, false), + new KafkaCosmosConfigEntry( + "kafka.connect.cosmos.sink.id.strategy", + IdStrategies.PROVIDED_IN_VALUE_STRATEGY.getName(), + true) + ); + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosDbSourceConnectorITest.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosSourceConnectorITest.java similarity index 96% rename from sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosDbSourceConnectorITest.java rename to sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosSourceConnectorITest.java index 9c9ef85c9a334..057755a47fc25 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosDbSourceConnectorITest.java +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosSourceConnectorITest.java @@ -27,14 +27,14 @@ import static org.assertj.core.api.AssertionsForClassTypes.assertThat; -public class CosmosDbSourceConnectorITest extends KafkaCosmosIntegrationTestSuiteBase { - private static final Logger logger = LoggerFactory.getLogger(CosmosDbSourceConnectorITest.class); +public class CosmosSourceConnectorITest extends KafkaCosmosIntegrationTestSuiteBase { + private static final Logger logger = LoggerFactory.getLogger(CosmosSourceConnectorITest.class); // TODO[public preview]: add more integration tests @Test(groups = { "kafka-integration"}, timeOut = TIMEOUT) public void readFromSingleContainer() { Map sourceConnectorConfig = new HashMap<>(); - sourceConnectorConfig.put("connector.class", "com.azure.cosmos.kafka.connect.CosmosDBSourceConnector"); + sourceConnectorConfig.put("connector.class", "com.azure.cosmos.kafka.connect.CosmosSourceConnector"); sourceConnectorConfig.put("kafka.connect.cosmos.accountEndpoint", KafkaCosmosTestConfigurations.HOST); sourceConnectorConfig.put("kafka.connect.cosmos.accountKey", KafkaCosmosTestConfigurations.MASTER_KEY); sourceConnectorConfig.put("kafka.connect.cosmos.applicationName", "Test"); diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosDBSourceConnectorTest.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosSourceConnectorTest.java similarity index 97% rename from sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosDBSourceConnectorTest.java rename to sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosSourceConnectorTest.java index 84aac6cacdcf0..e323ab8c810a8 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosDBSourceConnectorTest.java +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosSourceConnectorTest.java @@ -49,21 +49,21 @@ import java.util.UUID; import java.util.stream.Collectors; -import static com.azure.cosmos.kafka.connect.CosmosDBSourceConnectorTest.SourceConfigs.ALL_VALID_CONFIGS; +import static com.azure.cosmos.kafka.connect.CosmosSourceConnectorTest.SourceConfigs.ALL_VALID_CONFIGS; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; import static org.testng.Assert.assertEquals; @Test -public class CosmosDBSourceConnectorTest extends KafkaCosmosTestSuiteBase { +public class CosmosSourceConnectorTest extends KafkaCosmosTestSuiteBase { @Test(groups = "unit") public void taskClass() { - CosmosDBSourceConnector sourceConnector = new CosmosDBSourceConnector(); + CosmosSourceConnector sourceConnector = new CosmosSourceConnector(); assertEquals(sourceConnector.taskClass(), CosmosSourceTask.class); } @Test(groups = "unit") public void config() { - CosmosDBSourceConnector sourceConnector = new CosmosDBSourceConnector(); + CosmosSourceConnector sourceConnector = new CosmosSourceConnector(); ConfigDef configDef = sourceConnector.config(); Map configs = configDef.configKeys(); List> allValidConfigs = ALL_VALID_CONFIGS; @@ -82,7 +82,7 @@ public void config() { @Test(groups = "{ kafka }", timeOut = TIMEOUT) public void getTaskConfigsWithoutPersistedOffset() throws JsonProcessingException { - CosmosDBSourceConnector sourceConnector = new CosmosDBSourceConnector(); + CosmosSourceConnector sourceConnector = new CosmosSourceConnector(); try { Map sourceConfigMap = new HashMap<>(); sourceConfigMap.put("kafka.connect.cosmos.accountEndpoint", TestConfigurations.HOST); @@ -154,7 +154,7 @@ public void getTaskConfigsWithoutPersistedOffset() throws JsonProcessingExceptio @Test(groups = "{ kafka }", timeOut = TIMEOUT) public void getTaskConfigsAfterSplit() throws JsonProcessingException { // This test is to simulate after a split happen, the task resume with persisted offset - CosmosDBSourceConnector sourceConnector = new CosmosDBSourceConnector(); + CosmosSourceConnector sourceConnector = new CosmosSourceConnector(); try { Map sourceConfigMap = new HashMap<>(); @@ -249,7 +249,7 @@ public void getTaskConfigsAfterSplit() throws JsonProcessingException { @Test(groups = "{ kafka }", timeOut = TIMEOUT) public void getTaskConfigsAfterMerge() throws JsonProcessingException { // This test is to simulate after a merge happen, the task resume with previous feedRanges - CosmosDBSourceConnector sourceConnector = new CosmosDBSourceConnector(); + CosmosSourceConnector sourceConnector = new CosmosSourceConnector(); try { Map sourceConfigMap = new HashMap<>(); @@ -381,7 +381,7 @@ public void missingRequiredConfig() { .collect(Collectors.toList()); assertThat(requiredConfigs.size()).isGreaterThan(1); - CosmosDBSourceConnector sourceConnector = new CosmosDBSourceConnector(); + CosmosSourceConnector sourceConnector = new CosmosSourceConnector(); for (SourceConfigEntry configEntry : requiredConfigs) { Map sourceConfigMap = this.getValidSourceConfig(); @@ -402,7 +402,7 @@ public void missingRequiredConfig() { @Test(groups = "unit") public void misFormattedConfig() { - CosmosDBSourceConnector sourceConnector = new CosmosDBSourceConnector(); + CosmosSourceConnector sourceConnector = new CosmosSourceConnector(); Map sourceConfigMap = this.getValidSourceConfig(); String topicMapConfigName = "kafka.connect.cosmos.source.containers.topicMap"; @@ -442,7 +442,7 @@ private Map getValidSourceConfig() { return sourceConfigMap; } - private void setupDefaultConnectorInternalStates(CosmosDBSourceConnector sourceConnector, Map sourceConfigMap) { + private void setupDefaultConnectorInternalStates(CosmosSourceConnector sourceConnector, Map sourceConfigMap) { CosmosSourceConfig cosmosSourceConfig = new CosmosSourceConfig(sourceConfigMap); KafkaCosmosReflectionUtils.setCosmosSourceConfig(sourceConnector, cosmosSourceConfig); diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/KafkaCosmosConfigEntry.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/KafkaCosmosConfigEntry.java new file mode 100644 index 0000000000000..ec0ee09b3e65f --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/KafkaCosmosConfigEntry.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect; + +public class KafkaCosmosConfigEntry { + private final String name; + private final T defaultValue; + private final boolean isOptional; + + public KafkaCosmosConfigEntry(String name, T defaultValue, boolean isOptional) { + this.name = name; + this.defaultValue = defaultValue; + this.isOptional = isOptional; + } + + public String getName() { + return name; + } + + public T getDefaultValue() { + return defaultValue; + } + + public boolean isOptional() { + return isOptional; + } + +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/KafkaCosmosConnectContainer.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/KafkaCosmosConnectContainer.java index 6587222aaee5e..f0bef9d3d65cc 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/KafkaCosmosConnectContainer.java +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/KafkaCosmosConnectContainer.java @@ -8,8 +8,12 @@ import org.apache.kafka.clients.admin.AdminClient; import org.apache.kafka.clients.admin.NewTopic; import org.apache.kafka.clients.consumer.KafkaConsumer; +import org.apache.kafka.clients.producer.KafkaProducer; +import org.apache.kafka.clients.producer.ProducerConfig; import org.apache.kafka.common.serialization.StringDeserializer; +import org.apache.kafka.common.serialization.StringSerializer; import org.apache.kafka.connect.json.JsonDeserializer; +import org.apache.kafka.connect.json.JsonSerializer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.sourcelab.kafka.connect.apiclient.Configuration; @@ -28,6 +32,7 @@ public class KafkaCosmosConnectContainer extends GenericContainer kafkaConsumer; + private KafkaProducer kafkaProducer; private AdminClient adminClient; private int replicationFactor = 1; @@ -56,7 +61,7 @@ private void defaultConfig() { private Properties defaultConsumerConfig() { Properties kafkaConsumerProperties = new Properties(); - kafkaConsumerProperties.put("group.id", "IntegrationTest"); + kafkaConsumerProperties.put("group.id", "IntegrationTest-Consumer"); kafkaConsumerProperties.put("value.deserializer", JsonDeserializer.class.getName()); kafkaConsumerProperties.put("key.deserializer", StringDeserializer.class.getName()); kafkaConsumerProperties.put("sasl.mechanism", "PLAIN"); @@ -65,6 +70,21 @@ private Properties defaultConsumerConfig() { return kafkaConsumerProperties; } + private Properties defaultProducerConfig() { + Properties kafkaProducerProperties = new Properties(); + + kafkaProducerProperties.put(ProducerConfig.CLIENT_ID_CONFIG, "IntegrationTest-producer"); + kafkaProducerProperties.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName()); + kafkaProducerProperties.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, JsonSerializer.class.getName()); + kafkaProducerProperties.put(ProducerConfig.MAX_BLOCK_MS_CONFIG, 2000L); + kafkaProducerProperties.put(ProducerConfig.ACKS_CONFIG, "all"); + kafkaProducerProperties.put("sasl.mechanism", "PLAIN"); + kafkaProducerProperties.put("client.dns.lookup", "use_all_dns_ips"); + kafkaProducerProperties.put("session.timeout.ms", "45000"); + + return kafkaProducerProperties; + } + public KafkaCosmosConnectContainer withLocalKafkaContainer(final KafkaContainer kafkaContainer) { withNetwork(kafkaContainer.getNetwork()); @@ -92,6 +112,11 @@ public KafkaCosmosConnectContainer withLocalBootstrapServer(String localBootstra Properties consumerProperties = defaultConsumerConfig(); consumerProperties.put("bootstrap.servers", localBootstrapServer); this.kafkaConsumer = new KafkaConsumer<>(consumerProperties); + + Properties producerProperties = defaultProducerConfig(); + producerProperties.put("bootstrap.servers", localBootstrapServer); + this.kafkaProducer = new KafkaProducer<>(producerProperties); + this.adminClient = this.getAdminClient(localBootstrapServer); return self(); } @@ -104,6 +129,14 @@ public KafkaCosmosConnectContainer withCloudBootstrapServer() { consumerProperties.put("sasl.mechanism", "PLAIN"); this.kafkaConsumer = new KafkaConsumer<>(consumerProperties); + + Properties producerProperties = defaultProducerConfig(); + producerProperties.put("bootstrap.servers", KafkaCosmosTestConfigurations.BOOTSTRAP_SERVER); + producerProperties.put("sasl.jaas.config", KafkaCosmosTestConfigurations.SASL_JAAS); + producerProperties.put("security.protocol", "SASL_SSL"); + producerProperties.put("sasl.mechanism", "PLAIN"); + this.kafkaProducer = new KafkaProducer<>(producerProperties); + this.adminClient = this.getAdminClient(KafkaCosmosTestConfigurations.BOOTSTRAP_SERVER); this.replicationFactor = 3; return self(); @@ -142,6 +175,10 @@ public KafkaConsumer getConsumer() { return this.kafkaConsumer; } + public KafkaProducer getProducer() { + return this.kafkaProducer; + } + public String getTarget() { return "http://" + getContainerIpAddress() + ":" + getMappedPort(KAFKA_CONNECT_PORT); } diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/KafkaCosmosReflectionUtils.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/KafkaCosmosReflectionUtils.java index e15f33693460c..61c4c7d06553d 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/KafkaCosmosReflectionUtils.java +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/KafkaCosmosReflectionUtils.java @@ -4,10 +4,12 @@ package com.azure.cosmos.kafka.connect; import com.azure.cosmos.CosmosAsyncClient; +import com.azure.cosmos.kafka.connect.implementation.sink.CosmosSinkTask; import com.azure.cosmos.kafka.connect.implementation.source.CosmosSourceConfig; import com.azure.cosmos.kafka.connect.implementation.source.CosmosSourceOffsetStorageReader; import com.azure.cosmos.kafka.connect.implementation.source.MetadataMonitorThread; import org.apache.commons.lang3.reflect.FieldUtils; +import org.apache.kafka.connect.sink.SinkTaskContext; import org.apache.kafka.connect.storage.OffsetStorageReader; public class KafkaCosmosReflectionUtils { @@ -28,35 +30,43 @@ private static T get(Object object, String fieldName) { } } - public static void setCosmosClient(CosmosDBSourceConnector sourceConnector, CosmosAsyncClient cosmosAsyncClient) { + public static void setCosmosClient(CosmosSourceConnector sourceConnector, CosmosAsyncClient cosmosAsyncClient) { set(sourceConnector, cosmosAsyncClient,"cosmosClient"); } - public static void setCosmosSourceConfig(CosmosDBSourceConnector sourceConnector, CosmosSourceConfig sourceConfig) { + public static void setCosmosSourceConfig(CosmosSourceConnector sourceConnector, CosmosSourceConfig sourceConfig) { set(sourceConnector, sourceConfig,"config"); } public static void setOffsetStorageReader( - CosmosDBSourceConnector sourceConnector, + CosmosSourceConnector sourceConnector, CosmosSourceOffsetStorageReader storageReader) { set(sourceConnector, storageReader,"offsetStorageReader"); } public static void setMetadataMonitorThread( - CosmosDBSourceConnector sourceConnector, + CosmosSourceConnector sourceConnector, MetadataMonitorThread metadataMonitorThread) { set(sourceConnector, metadataMonitorThread,"monitorThread"); } - public static CosmosAsyncClient getCosmosClient(CosmosDBSourceConnector sourceConnector) { + public static CosmosAsyncClient getCosmosClient(CosmosSourceConnector sourceConnector) { return get(sourceConnector,"cosmosClient"); } - public static CosmosSourceOffsetStorageReader getSourceOffsetStorageReader(CosmosDBSourceConnector sourceConnector) { + public static CosmosSourceOffsetStorageReader getSourceOffsetStorageReader(CosmosSourceConnector sourceConnector) { return get(sourceConnector,"offsetStorageReader"); } public static OffsetStorageReader getOffsetStorageReader(CosmosSourceOffsetStorageReader sourceOffsetStorageReader) { return get(sourceOffsetStorageReader,"offsetStorageReader"); } + + public static void setSinkTaskContext(CosmosSinkTask sinkTask, SinkTaskContext sinkTaskContext) { + set(sinkTask, sinkTaskContext, "context"); + } + + public static CosmosAsyncClient getSinkTaskCosmosClient(CosmosSinkTask sinkTask) { + return get(sinkTask,"cosmosClient"); + } } diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/KafkaCosmosTestSuiteBase.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/KafkaCosmosTestSuiteBase.java index ac52e93574e05..ef2401aef3634 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/KafkaCosmosTestSuiteBase.java +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/KafkaCosmosTestSuiteBase.java @@ -88,7 +88,7 @@ protected static CosmosContainerProperties getSinglePartitionContainer(CosmosAsy credential = new AzureKeyCredential(KafkaCosmosTestConfigurations.MASTER_KEY); } - @BeforeSuite(groups = { "kafka" }, timeOut = SUITE_SETUP_TIMEOUT) + @BeforeSuite(groups = { "kafka", "kafka-integration" }, timeOut = SUITE_SETUP_TIMEOUT) public static void beforeSuite() { logger.info("beforeSuite Started"); @@ -120,7 +120,19 @@ public static void beforeSuite() { } } - @AfterSuite(groups = { "kafka" }, timeOut = SUITE_SHUTDOWN_TIMEOUT) + @BeforeSuite(groups = { "unit" }, timeOut = SUITE_SETUP_TIMEOUT) + public static void beforeSuiteUnit() { + logger.info("beforeSuite for unit tests started"); + + databaseName = + StringUtils.isEmpty(databaseName) ? "KafkaCosmosTest-" + UUID.randomUUID() : databaseName; + multiPartitionContainerName = + StringUtils.isEmpty(multiPartitionContainerName) ? UUID.randomUUID().toString() : multiPartitionContainerName; + singlePartitionContainerName = + StringUtils.isEmpty(singlePartitionContainerName) ? UUID.randomUUID().toString() : singlePartitionContainerName; + } + + @AfterSuite(groups = { "kafka", "kafka-integration" }, timeOut = SUITE_SHUTDOWN_TIMEOUT) public static void afterSuite() { logger.info("afterSuite Started"); diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkTaskTest.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkTaskTest.java new file mode 100644 index 0000000000000..89cc8322b0506 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/implementation/sink/CosmosSinkTaskTest.java @@ -0,0 +1,571 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink; + +import com.azure.cosmos.CosmosAsyncClient; +import com.azure.cosmos.CosmosAsyncContainer; +import com.azure.cosmos.implementation.TestConfigurations; +import com.azure.cosmos.implementation.Utils; +import com.azure.cosmos.kafka.connect.KafkaCosmosReflectionUtils; +import com.azure.cosmos.kafka.connect.KafkaCosmosTestSuiteBase; +import com.azure.cosmos.kafka.connect.TestItem; +import com.azure.cosmos.kafka.connect.implementation.source.JsonToStruct; +import com.azure.cosmos.models.CosmosContainerProperties; +import com.azure.cosmos.models.PartitionKey; +import com.azure.cosmos.test.faultinjection.CosmosFaultInjectionHelper; +import com.azure.cosmos.test.faultinjection.FaultInjectionConditionBuilder; +import com.azure.cosmos.test.faultinjection.FaultInjectionResultBuilders; +import com.azure.cosmos.test.faultinjection.FaultInjectionRule; +import com.azure.cosmos.test.faultinjection.FaultInjectionRuleBuilder; +import com.azure.cosmos.test.faultinjection.FaultInjectionServerErrorType; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.node.ObjectNode; +import org.apache.kafka.connect.data.ConnectSchema; +import org.apache.kafka.connect.data.Schema; +import org.apache.kafka.connect.data.SchemaAndValue; +import org.apache.kafka.connect.sink.SinkRecord; +import org.apache.kafka.connect.sink.SinkTaskContext; +import org.mockito.Mockito; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import reactor.core.publisher.Mono; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.stream.Collectors; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; + + +public class CosmosSinkTaskTest extends KafkaCosmosTestSuiteBase { + @DataProvider(name = "sinkTaskParameterProvider") + public Object[][] sinkTaskParameterProvider() { + return new Object[][]{ + // flag to indicate whether bulk enabled or not, sink record value schema + { true, Schema.Type.MAP }, + { false, Schema.Type.MAP }, + { true, Schema.Type.STRUCT }, + { false, Schema.Type.STRUCT } + }; + } + + @DataProvider(name = "bulkEnableParameterProvider") + public Object[][] bulkEnableParameterProvider() { + return new Object[][]{ + // flag to indicate whether bulk enabled or not + { true }, + { false } + }; + } + + @Test(groups = { "kafka" }, dataProvider = "sinkTaskParameterProvider", timeOut = TIMEOUT) + public void sinkWithValidRecords(boolean bulkEnabled, Schema.Type valueSchemaType) { + String topicName = singlePartitionContainerName; + + Map sinkConfigMap = new HashMap<>(); + sinkConfigMap.put("kafka.connect.cosmos.accountEndpoint", TestConfigurations.HOST); + sinkConfigMap.put("kafka.connect.cosmos.accountKey", TestConfigurations.MASTER_KEY); + sinkConfigMap.put("kafka.connect.cosmos.sink.database.name", databaseName); + sinkConfigMap.put("kafka.connect.cosmos.sink.containers.topicMap", topicName + "#" + singlePartitionContainerName); + sinkConfigMap.put("kafka.connect.cosmos.sink.bulk.enabled", String.valueOf(bulkEnabled)); + + CosmosSinkTask sinkTask = new CosmosSinkTask(); + SinkTaskContext sinkTaskContext = Mockito.mock(SinkTaskContext.class); + Mockito.when(sinkTaskContext.errantRecordReporter()).thenReturn(null); + KafkaCosmosReflectionUtils.setSinkTaskContext(sinkTask, sinkTaskContext); + sinkTask.start(sinkConfigMap); + + CosmosAsyncClient cosmosClient = KafkaCosmosReflectionUtils.getSinkTaskCosmosClient(sinkTask); + CosmosContainerProperties singlePartitionContainerProperties = getSinglePartitionContainer(cosmosClient); + CosmosAsyncContainer container = cosmosClient.getDatabase(databaseName).getContainer(singlePartitionContainerProperties.getId()); + + try { + List sinkRecordList = new ArrayList<>(); + List toBeCreateItems = new ArrayList<>(); + this.createSinkRecords( + 10, + topicName, + valueSchemaType, + toBeCreateItems, + sinkRecordList); + + sinkTask.put(sinkRecordList); + + // get all the items + List writtenItemIds = new ArrayList<>(); + String query = "select * from c"; + container.queryItems(query, TestItem.class) + .byPage() + .flatMap(response -> { + writtenItemIds.addAll( + response.getResults().stream().map(TestItem::getId).collect(Collectors.toList())); + return Mono.empty(); + }) + .blockLast(); + + assertThat(writtenItemIds.size()).isEqualTo(toBeCreateItems.size()); + List toBeCreateItemIds = toBeCreateItems.stream().map(TestItem::getId).collect(Collectors.toList()); + assertThat(writtenItemIds.containsAll(toBeCreateItemIds)).isTrue(); + + } finally { + if (cosmosClient != null) { + cleanUpContainer(cosmosClient, databaseName, singlePartitionContainerProperties.getId()); + sinkTask.stop(); + } + } + } + + @Test(groups = { "kafka" }, dataProvider = "bulkEnableParameterProvider", timeOut = 10 * TIMEOUT) + public void retryOnServiceUnavailable(boolean bulkEnabled) { + String topicName = singlePartitionContainerName; + + Map sinkConfigMap = new HashMap<>(); + sinkConfigMap.put("kafka.connect.cosmos.accountEndpoint", TestConfigurations.HOST); + sinkConfigMap.put("kafka.connect.cosmos.accountKey", TestConfigurations.MASTER_KEY); + sinkConfigMap.put("kafka.connect.cosmos.sink.database.name", databaseName); + sinkConfigMap.put("kafka.connect.cosmos.sink.containers.topicMap", topicName + "#" + singlePartitionContainerName); + sinkConfigMap.put("kafka.connect.cosmos.sink.bulk.enabled", String.valueOf(bulkEnabled)); + + CosmosSinkTask sinkTask = new CosmosSinkTask(); + SinkTaskContext sinkTaskContext = Mockito.mock(SinkTaskContext.class); + Mockito.when(sinkTaskContext.errantRecordReporter()).thenReturn(null); + KafkaCosmosReflectionUtils.setSinkTaskContext(sinkTask, sinkTaskContext); + sinkTask.start(sinkConfigMap); + + CosmosAsyncClient cosmosClient = KafkaCosmosReflectionUtils.getSinkTaskCosmosClient(sinkTask); + CosmosContainerProperties singlePartitionContainerProperties = getSinglePartitionContainer(cosmosClient); + CosmosAsyncContainer container = cosmosClient.getDatabase(databaseName).getContainer(singlePartitionContainerProperties.getId()); + + // configure fault injection rule + FaultInjectionRule goneExceptionRule = + new FaultInjectionRuleBuilder("goneExceptionRule-" + UUID.randomUUID()) + .condition(new FaultInjectionConditionBuilder().build()) + .result( + FaultInjectionResultBuilders + .getResultBuilder(FaultInjectionServerErrorType.GONE) + .build()) + // high enough so the batch requests will fail with 503 in the first time but low enough so the second retry from kafka connector can succeed + .hitLimit(10) + .build(); + + try { + List sinkRecordList = new ArrayList<>(); + List toBeCreateItems = new ArrayList<>(); + this.createSinkRecords( + 10, + topicName, + Schema.Type.STRUCT, + toBeCreateItems, + sinkRecordList); + + CosmosFaultInjectionHelper.configureFaultInjectionRules(container, Arrays.asList(goneExceptionRule)).block(); + sinkTask.put(sinkRecordList); + + // get all the items + List writtenItemIds = new ArrayList<>(); + String query = "select * from c"; + container.queryItems(query, TestItem.class) + .byPage() + .flatMap(response -> { + writtenItemIds.addAll( + response.getResults().stream().map(TestItem::getId).collect(Collectors.toList())); + return Mono.empty(); + }) + .blockLast(); + + assertThat(writtenItemIds.size()).isEqualTo(toBeCreateItems.size()); + List toBeCreateItemIds = toBeCreateItems.stream().map(TestItem::getId).collect(Collectors.toList()); + assertThat(toBeCreateItemIds.containsAll(writtenItemIds)).isTrue(); + + } finally { + goneExceptionRule.disable(); + if (cosmosClient != null) { + cleanUpContainer(cosmosClient, databaseName, singlePartitionContainerProperties.getId()); + cosmosClient.close(); + } + } + } + + @Test(groups = { "kafka" }, dataProvider = "bulkEnableParameterProvider", timeOut = TIMEOUT) + public void sinkWithItemAppend(boolean bulkEnabled) { + String topicName = singlePartitionContainerName; + + Map sinkConfigMap = new HashMap<>(); + sinkConfigMap.put("kafka.connect.cosmos.accountEndpoint", TestConfigurations.HOST); + sinkConfigMap.put("kafka.connect.cosmos.accountKey", TestConfigurations.MASTER_KEY); + sinkConfigMap.put("kafka.connect.cosmos.sink.database.name", databaseName); + sinkConfigMap.put("kafka.connect.cosmos.sink.containers.topicMap", topicName + "#" + singlePartitionContainerName); + sinkConfigMap.put("kafka.connect.cosmos.sink.bulk.enabled", String.valueOf(bulkEnabled)); + sinkConfigMap.put("kafka.connect.cosmos.sink.write.strategy", ItemWriteStrategy.ITEM_APPEND.getName()); + + CosmosSinkTask sinkTask = new CosmosSinkTask(); + SinkTaskContext sinkTaskContext = Mockito.mock(SinkTaskContext.class); + Mockito.when(sinkTaskContext.errantRecordReporter()).thenReturn(null); + KafkaCosmosReflectionUtils.setSinkTaskContext(sinkTask, sinkTaskContext); + sinkTask.start(sinkConfigMap); + + CosmosAsyncClient cosmosClient = KafkaCosmosReflectionUtils.getSinkTaskCosmosClient(sinkTask); + CosmosContainerProperties singlePartitionContainerProperties = getSinglePartitionContainer(cosmosClient); + CosmosAsyncContainer container = cosmosClient.getDatabase(databaseName).getContainer(singlePartitionContainerProperties.getId()); + + try { + List sinkRecordList = new ArrayList<>(); + List toBeCreateItems = new ArrayList<>(); + this.createSinkRecords( + 10, + topicName, + Schema.Type.MAP, + toBeCreateItems, + sinkRecordList); + + sinkTask.put(sinkRecordList); + + // get all the items + List writtenItemIds = this.getAllItemIds(container); + + assertThat(toBeCreateItems.size()).isEqualTo(writtenItemIds.size()); + List toBeCreateItemIds = toBeCreateItems.stream().map(TestItem::getId).collect(Collectors.toList()); + assertThat(toBeCreateItemIds.containsAll(writtenItemIds)).isTrue(); + + // add the same batch sink records, 409 should be ignored + sinkTask.put(sinkRecordList); + } finally { + if (cosmosClient != null) { + cleanUpContainer(cosmosClient, databaseName, singlePartitionContainerProperties.getId()); + sinkTask.stop(); + } + } + } + + @Test(groups = { "kafka" }, dataProvider = "bulkEnableParameterProvider", timeOut = 3 * TIMEOUT) + public void sinkWithItemOverwriteIfNotModified(boolean bulkEnabled) { + String topicName = singlePartitionContainerName; + + Map sinkConfigMap = new HashMap<>(); + sinkConfigMap.put("kafka.connect.cosmos.accountEndpoint", TestConfigurations.HOST); + sinkConfigMap.put("kafka.connect.cosmos.accountKey", TestConfigurations.MASTER_KEY); + sinkConfigMap.put("kafka.connect.cosmos.sink.database.name", databaseName); + sinkConfigMap.put("kafka.connect.cosmos.sink.containers.topicMap", topicName + "#" + singlePartitionContainerName); + sinkConfigMap.put("kafka.connect.cosmos.sink.bulk.enabled", String.valueOf(bulkEnabled)); + sinkConfigMap.put("kafka.connect.cosmos.sink.write.strategy", ItemWriteStrategy.ITEM_OVERWRITE_IF_NOT_MODIFIED.getName()); + + CosmosSinkTask sinkTask = new CosmosSinkTask(); + SinkTaskContext sinkTaskContext = Mockito.mock(SinkTaskContext.class); + Mockito.when(sinkTaskContext.errantRecordReporter()).thenReturn(null); + KafkaCosmosReflectionUtils.setSinkTaskContext(sinkTask, sinkTaskContext); + sinkTask.start(sinkConfigMap); + + CosmosAsyncClient cosmosClient = KafkaCosmosReflectionUtils.getSinkTaskCosmosClient(sinkTask); + CosmosContainerProperties singlePartitionContainerProperties = getSinglePartitionContainer(cosmosClient); + CosmosAsyncContainer container = cosmosClient.getDatabase(databaseName).getContainer(singlePartitionContainerProperties.getId()); + + try { + List sinkRecordList = new ArrayList<>(); + List toBeCreateItems = new ArrayList<>(); + this.createSinkRecords( + 10, + topicName, + Schema.Type.MAP, + toBeCreateItems, + sinkRecordList); + + sinkTask.put(sinkRecordList); + + // get all the items + List writtenItemIds = this.getAllItemIds(container); + + assertThat(toBeCreateItems.size()).isEqualTo(writtenItemIds.size()); + List toBeCreateItemIds = toBeCreateItems.stream().map(TestItem::getId).collect(Collectors.toList()); + assertThat(toBeCreateItemIds.containsAll(writtenItemIds)).isTrue(); + + ObjectNode existedItem = + container + .readItem(toBeCreateItems.get(0).getId(), new PartitionKey(toBeCreateItems.get(0).getMypk()), ObjectNode.class) + .block() + .getItem(); + + // test precondition-failed exception will be ignored + logger.info( + "Testing precondition-failed exception will be ignored for ItemWriteStrategy " + + ItemWriteStrategy.ITEM_OVERWRITE_IF_NOT_MODIFIED.getName()); + + ObjectNode itemWithWrongEtag = Utils.getSimpleObjectMapper().createObjectNode(); + itemWithWrongEtag.setAll(existedItem); + itemWithWrongEtag.put("_etag", UUID.randomUUID().toString()); + SinkRecord sinkRecordWithWrongEtag = + this.getSinkRecord( + topicName, + itemWithWrongEtag, + new ConnectSchema(Schema.Type.STRING), + itemWithWrongEtag.get("id").asText(), + Schema.Type.MAP); + + sinkTask.put(Arrays.asList(sinkRecordWithWrongEtag)); + + // test with correct etag, the item can be modified + logger.info( + "Testing item can be modified with correct etag for ItemWriteStrategy " + + ItemWriteStrategy.ITEM_OVERWRITE_IF_NOT_MODIFIED.getName()); + ObjectNode modifiedItem = Utils.getSimpleObjectMapper().createObjectNode(); + modifiedItem.setAll(existedItem); + modifiedItem.put("prop", UUID.randomUUID().toString()); + SinkRecord sinkRecordWithModifiedItem = + this.getSinkRecord( + topicName, + modifiedItem, + new ConnectSchema(Schema.Type.STRING), + modifiedItem.get("id").asText(), + Schema.Type.MAP); + sinkTask.put(Arrays.asList(sinkRecordWithModifiedItem)); + + existedItem = + container + .readItem(toBeCreateItems.get(0).getId(), new PartitionKey(toBeCreateItems.get(0).getMypk()), ObjectNode.class) + .block() + .getItem(); + assertThat(existedItem.get("prop").asText()).isEqualTo(modifiedItem.get("prop").asText()); + + } finally { + if (cosmosClient != null) { + cleanUpContainer(cosmosClient, databaseName, singlePartitionContainerProperties.getId()); + sinkTask.stop(); + } + } + } + + @Test(groups = { "kafka" }, dataProvider = "bulkEnableParameterProvider", timeOut = 3 * TIMEOUT) + public void sinkWithItemDelete(boolean bulkEnabled) { + String topicName = singlePartitionContainerName; + + Map sinkConfigMap = new HashMap<>(); + sinkConfigMap.put("kafka.connect.cosmos.accountEndpoint", TestConfigurations.HOST); + sinkConfigMap.put("kafka.connect.cosmos.accountKey", TestConfigurations.MASTER_KEY); + sinkConfigMap.put("kafka.connect.cosmos.sink.database.name", databaseName); + sinkConfigMap.put("kafka.connect.cosmos.sink.containers.topicMap", topicName + "#" + singlePartitionContainerName); + sinkConfigMap.put("kafka.connect.cosmos.sink.bulk.enabled", String.valueOf(bulkEnabled)); + sinkConfigMap.put("kafka.connect.cosmos.sink.write.strategy", ItemWriteStrategy.ITEM_DELETE.getName()); + + CosmosSinkTask sinkTask = new CosmosSinkTask(); + SinkTaskContext sinkTaskContext = Mockito.mock(SinkTaskContext.class); + Mockito.when(sinkTaskContext.errantRecordReporter()).thenReturn(null); + KafkaCosmosReflectionUtils.setSinkTaskContext(sinkTask, sinkTaskContext); + sinkTask.start(sinkConfigMap); + + CosmosAsyncClient cosmosClient = KafkaCosmosReflectionUtils.getSinkTaskCosmosClient(sinkTask); + CosmosContainerProperties singlePartitionContainerProperties = getSinglePartitionContainer(cosmosClient); + CosmosAsyncContainer container = cosmosClient.getDatabase(databaseName).getContainer(singlePartitionContainerProperties.getId()); + + try { + List sinkRecordList = new ArrayList<>(); + List toBeCreateItems = new ArrayList<>(); + this.createSinkRecords( + 10, + topicName, + Schema.Type.MAP, + toBeCreateItems, + sinkRecordList); + + // first time delete, ignore 404 exceptions + sinkTask.put(sinkRecordList); + + // creating the items in the container + for (TestItem testItem : toBeCreateItems) { + container.createItem(testItem).block(); + } + + // get all the items + List createdItemIds = this.getAllItemIds(container); + + assertThat(toBeCreateItems.size()).isEqualTo(createdItemIds.size()); + List toBeCreateItemIds = toBeCreateItems.stream().map(TestItem::getId).collect(Collectors.toList()); + assertThat(toBeCreateItemIds.containsAll(createdItemIds)).isTrue(); + + // now using the connector to delete the items + sinkTask.put(sinkRecordList); + + // verify all the items have deleted + List existingItemIds = this.getAllItemIds(container); + + assertThat(existingItemIds.isEmpty()).isTrue(); + + } finally { + if (cosmosClient != null) { + cleanUpContainer(cosmosClient, databaseName, singlePartitionContainerProperties.getId()); + sinkTask.stop(); + } + } + } + + @Test(groups = { "kafka" }, dataProvider = "bulkEnableParameterProvider", timeOut = 3 * TIMEOUT) + public void sinkWithItemDeleteIfNotModified(boolean bulkEnabled) throws InterruptedException { + String topicName = singlePartitionContainerName; + + Map sinkConfigMap = new HashMap<>(); + sinkConfigMap.put("kafka.connect.cosmos.accountEndpoint", TestConfigurations.HOST); + sinkConfigMap.put("kafka.connect.cosmos.accountKey", TestConfigurations.MASTER_KEY); + sinkConfigMap.put("kafka.connect.cosmos.sink.database.name", databaseName); + sinkConfigMap.put("kafka.connect.cosmos.sink.containers.topicMap", topicName + "#" + singlePartitionContainerName); + sinkConfigMap.put("kafka.connect.cosmos.sink.bulk.enabled", String.valueOf(bulkEnabled)); + sinkConfigMap.put("kafka.connect.cosmos.sink.write.strategy", ItemWriteStrategy.ITEM_DELETE_IF_NOT_MODIFIED.getName()); + + CosmosSinkTask sinkTask = new CosmosSinkTask(); + SinkTaskContext sinkTaskContext = Mockito.mock(SinkTaskContext.class); + Mockito.when(sinkTaskContext.errantRecordReporter()).thenReturn(null); + KafkaCosmosReflectionUtils.setSinkTaskContext(sinkTask, sinkTaskContext); + sinkTask.start(sinkConfigMap); + + CosmosAsyncClient cosmosClient = KafkaCosmosReflectionUtils.getSinkTaskCosmosClient(sinkTask); + CosmosContainerProperties singlePartitionContainerProperties = getSinglePartitionContainer(cosmosClient); + CosmosAsyncContainer container = cosmosClient.getDatabase(databaseName).getContainer(singlePartitionContainerProperties.getId()); + + try { + List sinkRecordList = new ArrayList<>(); + List toBeCreateItems = new ArrayList<>(); + this.createSinkRecords( + 10, + topicName, + Schema.Type.MAP, + toBeCreateItems, + sinkRecordList); + + // first time delete, ignore 404 exceptions + sinkTask.put(sinkRecordList); + + // creating the items in the container + for (TestItem testItem : toBeCreateItems) { + container.createItem(testItem).block(); + } + + // get all the items + List createdItems = this.getAllItems(container); + List createdItemIds = + createdItems + .stream() + .map(objectNode -> objectNode.get("id").asText()) + .collect(Collectors.toList()); + List expectItemIds = toBeCreateItems.stream().map(TestItem::getId).collect(Collectors.toList()); + assertThat(toBeCreateItems.size()).isEqualTo(createdItemIds.size()); + assertThat(expectItemIds.containsAll(createdItemIds)).isTrue(); + + // using wrong etag to delete the items, verify no item will be deleted + List sinkRecordsWithWrongEtag = new ArrayList<>(); + for (ObjectNode createdItem : createdItems) { + ObjectNode testItemWithWrongEtag = Utils.getSimpleObjectMapper().createObjectNode(); + testItemWithWrongEtag.setAll(createdItem); + testItemWithWrongEtag.put("_etag", UUID.randomUUID().toString()); + sinkRecordsWithWrongEtag.add( + this.getSinkRecord( + topicName, + testItemWithWrongEtag, + new ConnectSchema(Schema.Type.STRING), + createdItem.get("id").asText(), + Schema.Type.STRUCT) + ); + } + sinkTask.put(sinkRecordsWithWrongEtag); + Thread.sleep(500); // delete happens in the background + List existingItemIds = this.getAllItemIds(container); + assertThat(existingItemIds.size()).isEqualTo(createdItemIds.size()); + assertThat(existingItemIds.containsAll(createdItemIds)).isTrue(); + + // verify all the items have deleted + List sinkRecordsWithCorrectEtag = new ArrayList<>(); + for (ObjectNode createdItem : createdItems) { + sinkRecordsWithCorrectEtag.add( + this.getSinkRecord( + topicName, + createdItem, + new ConnectSchema(Schema.Type.STRING), + createdItem.get("id").asText(), + Schema.Type.STRUCT) + ); + } + + sinkTask.put(sinkRecordsWithCorrectEtag); + Thread.sleep(500); // delete happens in the background + existingItemIds = this.getAllItemIds(container); + assertThat(existingItemIds.isEmpty()).isTrue(); + + } finally { + if (cosmosClient != null) { + cleanUpContainer(cosmosClient, databaseName, singlePartitionContainerProperties.getId()); + sinkTask.stop(); + } + } + } + + private SinkRecord getSinkRecord( + String topicName, + ObjectNode objectNode, + Schema keySchema, + String keyValue, + Schema.Type valueSchemaType) { + if (valueSchemaType == Schema.Type.STRUCT) { + SchemaAndValue schemaAndValue = + JsonToStruct.recordToSchemaAndValue(objectNode); + + return new SinkRecord( + topicName, + 1, + keySchema, + keyValue, + schemaAndValue.schema(), + schemaAndValue.value(), + 0L); + } else { + return new SinkRecord( + topicName, + 1, + keySchema, + keyValue, + new ConnectSchema(Schema.Type.MAP), + Utils.getSimpleObjectMapper().convertValue(objectNode, new TypeReference>() {}), + 0L); + } + } + + private void createSinkRecords( + int numberOfItems, + String topicName, + Schema.Type valueSchemaType, + List createdItems, + List sinkRecordList) { + + Schema keySchema = new ConnectSchema(Schema.Type.STRING); + + for (int i = 0; i < numberOfItems; i++) { + TestItem testItem = TestItem.createNewItem(); + createdItems.add(testItem); + + SinkRecord sinkRecord = + this.getSinkRecord( + topicName, + Utils.getSimpleObjectMapper().convertValue(testItem, ObjectNode.class), + keySchema, + testItem.getId(), + valueSchemaType); + sinkRecordList.add(sinkRecord); + } + } + + private List getAllItemIds(CosmosAsyncContainer container) { + return getAllItems(container) + .stream() + .map(objectNode -> objectNode.get("id").asText()) + .collect(Collectors.toList()); + } + + private List getAllItems(CosmosAsyncContainer container) { + String query = "select * from c"; + return container.queryItems(query, ObjectNode.class) + .byPage() + .flatMapIterable(response -> response.getResults()) + .collectList() + .block(); + } +} diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/implementation/sink/idStrategy/ProvidedInStrategyTest.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/implementation/sink/idStrategy/ProvidedInStrategyTest.java new file mode 100644 index 0000000000000..19c8fb92dd374 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/implementation/sink/idStrategy/ProvidedInStrategyTest.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.cosmos.kafka.connect.implementation.sink.idStrategy; + +import com.azure.cosmos.kafka.connect.implementation.sink.idstrategy.IdStrategy; +import com.azure.cosmos.kafka.connect.implementation.sink.idstrategy.ProvidedInConfig; +import com.azure.cosmos.kafka.connect.implementation.sink.idstrategy.ProvidedInKeyStrategy; +import com.azure.cosmos.kafka.connect.implementation.sink.idstrategy.ProvidedInValueStrategy; +import org.apache.kafka.connect.data.Schema; +import org.apache.kafka.connect.data.SchemaBuilder; +import org.apache.kafka.connect.data.Struct; +import org.apache.kafka.connect.errors.ConnectException; +import org.apache.kafka.connect.sink.SinkRecord; +import org.mockito.Mockito; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; +import static org.mockito.Mockito.when; + +public class ProvidedInStrategyTest { + protected static final int TIMEOUT = 60000; + + @DataProvider(name = "idStrategyParameterProvider") + public static Object[][] idStrategyParameterProvider() { + return new Object[][]{ + { new ProvidedInValueStrategy() }, + { new ProvidedInKeyStrategy() }, + }; + } + + private void returnOnKeyOrValue( + Schema schema, + Object ret, + IdStrategy idStrategy, + SinkRecord sinkRecord) { + if (idStrategy.getClass() == ProvidedInKeyStrategy.class) { + when(sinkRecord.keySchema()).thenReturn(schema); + when(sinkRecord.key()).thenReturn(ret); + } else { + when(sinkRecord.valueSchema()).thenReturn(schema); + when(sinkRecord.value()).thenReturn(ret); + } + } + + @Test(groups = { "unit" }, dataProvider = "idStrategyParameterProvider", expectedExceptions = ConnectException.class, timeOut = TIMEOUT) + public void valueNotStructOrMapShouldFail(IdStrategy idStrategy) { + idStrategy.configure(new HashMap<>()); + SinkRecord sinkRecord = Mockito.mock(SinkRecord.class); + returnOnKeyOrValue(Schema.STRING_SCHEMA, "a string", idStrategy, sinkRecord); + idStrategy.generateId(sinkRecord); + } + + @Test(groups = { "unit" }, dataProvider = "idStrategyParameterProvider", expectedExceptions = ConnectException.class, timeOut = TIMEOUT) + public void noIdInValueShouldFail(IdStrategy idStrategy) { + idStrategy.configure(new HashMap<>()); + SinkRecord sinkRecord = Mockito.mock(SinkRecord.class); + returnOnKeyOrValue(null, new HashMap<>(), idStrategy, sinkRecord); + idStrategy.generateId(sinkRecord); + } + + @Test(groups = { "unit" }, dataProvider = "idStrategyParameterProvider", timeOut = TIMEOUT) + public void stringIdOnMapShouldReturn(IdStrategy idStrategy) { + idStrategy.configure(new HashMap<>()); + SinkRecord sinkRecord = Mockito.mock(SinkRecord.class); + returnOnKeyOrValue( + null, + new HashMap(){{ put("id", "1234567"); }}, + idStrategy, + sinkRecord); + assertThat("1234567").isEqualTo(idStrategy.generateId(sinkRecord)); + } + + @Test(groups = { "unit" }, dataProvider = "idStrategyParameterProvider", timeOut = TIMEOUT) + public void nonStringIdOnMapShouldReturn(IdStrategy idStrategy) { + idStrategy.configure(new HashMap<>()); + SinkRecord sinkRecord = Mockito.mock(SinkRecord.class); + returnOnKeyOrValue( + null, + new HashMap(){{ put("id", 1234567); }}, + idStrategy, + sinkRecord); + assertThat("1234567").isEqualTo(idStrategy.generateId(sinkRecord)); + } + + @Test(groups = { "unit" }, dataProvider = "idStrategyParameterProvider", timeOut = TIMEOUT) + public void stringIdOnStructShouldReturn(IdStrategy idStrategy) { + idStrategy.configure(new HashMap<>()); + Schema schema = SchemaBuilder.struct() + .field("id", Schema.STRING_SCHEMA) + .build(); + + SinkRecord sinkRecord = Mockito.mock(SinkRecord.class); + Struct struct = new Struct(schema).put("id", "1234567"); + returnOnKeyOrValue(struct.schema(), struct, idStrategy, sinkRecord); + + assertThat("1234567").isEqualTo(idStrategy.generateId(sinkRecord)); + } + + @Test(groups = { "unit" }, dataProvider = "idStrategyParameterProvider", timeOut = TIMEOUT) + public void structIdOnStructShouldReturn(IdStrategy idStrategy) { + idStrategy.configure(new HashMap<>()); + Schema idSchema = SchemaBuilder.struct() + .field("name", Schema.STRING_SCHEMA) + .build(); + Schema schema = SchemaBuilder.struct() + .field("id", idSchema) + .build(); + Struct struct = new Struct(schema) + .put("id", new Struct(idSchema).put("name", "cosmos kramer")); + SinkRecord sinkRecord = Mockito.mock(SinkRecord.class); + returnOnKeyOrValue(struct.schema(), struct, idStrategy, sinkRecord); + + assertThat("{\"name\":\"cosmos kramer\"}").isEqualTo(idStrategy.generateId(sinkRecord)); + } + + @Test(groups = { "unit" }, dataProvider = "idStrategyParameterProvider", timeOut = TIMEOUT) + public void jsonPathOnStruct(IdStrategy idStrategy) { + idStrategy.configure(new HashMap(){{ put(ProvidedInConfig.JSON_PATH_CONFIG, "$.id.name"); }}); + + Schema idSchema = SchemaBuilder.struct() + .field("name", Schema.STRING_SCHEMA) + .build(); + Schema schema = SchemaBuilder.struct() + .field("id", idSchema) + .build(); + Struct struct = new Struct(schema) + .put("id", new Struct(idSchema).put("name", "franz kafka")); + + SinkRecord sinkRecord = Mockito.mock(SinkRecord.class); + returnOnKeyOrValue(struct.schema(), struct, idStrategy, sinkRecord); + assertThat("franz kafka").isEqualTo(idStrategy.generateId(sinkRecord)); + } + + @Test(groups = { "unit" }, dataProvider = "idStrategyParameterProvider", timeOut = TIMEOUT) + public void jsonPathOnMap(IdStrategy idStrategy) { + idStrategy.configure(new HashMap(){{ put(ProvidedInConfig.JSON_PATH_CONFIG, "$.id.name"); }}); + + SinkRecord sinkRecord = Mockito.mock(SinkRecord.class); + returnOnKeyOrValue( + null, + new HashMap(){{ put("id", new HashMap(){{ put("name", "franz kafka"); }}); }}, + idStrategy, + sinkRecord); + assertThat("franz kafka").isEqualTo(idStrategy.generateId(sinkRecord)); + } + + @Test(groups = { "unit" }, dataProvider = "idStrategyParameterProvider", expectedExceptions = ConnectException.class, timeOut = TIMEOUT) + public void invalidJsonPathThrows(IdStrategy idStrategy) { + idStrategy.configure(new HashMap(){{ put(ProvidedInConfig.JSON_PATH_CONFIG, "invalid.path"); }}); + SinkRecord sinkRecord = Mockito.mock(SinkRecord.class); + returnOnKeyOrValue( + null, + new HashMap(){{ put("id", new HashMap(){{ put("name", "franz kafka"); }}); }}, + idStrategy, + sinkRecord); + + idStrategy.generateId(sinkRecord); + } + + @Test(groups = { "unit" }, dataProvider = "idStrategyParameterProvider", expectedExceptions = ConnectException.class, timeOut = TIMEOUT) + public void jsonPathNotExistThrows(IdStrategy idStrategy) { + idStrategy.configure(new HashMap(){{ put(ProvidedInConfig.JSON_PATH_CONFIG, "$.id.not.exist"); }}); + SinkRecord sinkRecord = Mockito.mock(SinkRecord.class); + returnOnKeyOrValue( + null, + new HashMap(){{ put("id", new HashMap(){{ put("name", "franz kafka"); }}); }}, + idStrategy, + sinkRecord); + + idStrategy.generateId(sinkRecord); + } + + @Test(groups = { "unit" }, dataProvider = "idStrategyParameterProvider", timeOut = TIMEOUT) + public void complexJsonPath(IdStrategy idStrategy) { + Map map1 = new LinkedHashMap<>(); + map1.put("id", 0); + map1.put("name", "cosmos kramer"); + map1.put("occupation", "unknown"); + Map map2 = new LinkedHashMap<>(); + map2.put("id", 1); + map2.put("name", "franz kafka"); + map2.put("occupation", "writer"); + + SinkRecord sinkRecord = Mockito.mock(SinkRecord.class); + returnOnKeyOrValue( + null, + new HashMap() {{ put("id", Arrays.asList(map1, map2)); }}, + idStrategy, + sinkRecord); + + idStrategy.configure(new HashMap(){{ put(ProvidedInConfig.JSON_PATH_CONFIG, "$.id[0].name"); }}); + assertThat("cosmos kramer").isEqualTo(idStrategy.generateId(sinkRecord)); + + idStrategy.configure(new HashMap(){{ put(ProvidedInConfig.JSON_PATH_CONFIG, "$.id[1].name"); }}); + assertThat("franz kafka").isEqualTo(idStrategy.generateId(sinkRecord)); + + idStrategy.configure(new HashMap(){{ put(ProvidedInConfig.JSON_PATH_CONFIG, "$.id[*].id"); }}); + assertThat("[0,1]").isEqualTo(idStrategy.generateId(sinkRecord)); + + idStrategy.configure(new HashMap(){{ put(ProvidedInConfig.JSON_PATH_CONFIG, "$.id"); }}); + assertThat("[{\"id\":0,\"name\":\"cosmos kramer\",\"occupation\":\"unknown\"},{\"id\":1,\"name\":\"franz kafka\",\"occupation\":\"writer\"}]").isEqualTo(idStrategy.generateId(sinkRecord)); + } + + @Test(groups = { "unit" }, dataProvider = "idStrategyParameterProvider", timeOut = TIMEOUT) + public void generatedIdSanitized(IdStrategy idStrategy) { + idStrategy.configure(new HashMap<>()); + SinkRecord sinkRecord = Mockito.mock(SinkRecord.class); + returnOnKeyOrValue( + null, + new HashMap() {{put("id", "#my/special\\id?");}}, + idStrategy, + sinkRecord); + + assertThat("_my_special_id_").isEqualTo(idStrategy.generateId(sinkRecord)); + } +} diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/CosmosAsyncContainer.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/CosmosAsyncContainer.java index fff63f1feefdf..e068e9b8066e5 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/CosmosAsyncContainer.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/CosmosAsyncContainer.java @@ -2641,6 +2641,20 @@ Mono checkFeedRangeOverlapping(FeedRange feedRange1, FeedRange feedRang }); } + Mono getPartitionKeyDefinition() { + final AsyncDocumentClient clientWrapper = this.database.getDocClientWrapper(); + return Mono.just(clientWrapper.getCollectionCache()) + .flatMap(collectionCache -> { + return collectionCache + .resolveByNameAsync( + null, + this.getLinkWithoutTrailingSlash(), + null, + null) + .map(documentCollection -> documentCollection.getPartitionKey()); + }); + } + /** * Enable the throughput control group with local control mode. *
@@ -2842,6 +2856,16 @@ public Mono checkFeedRangeOverlapping( public Mono> getOverlappingFeedRanges(CosmosAsyncContainer container, FeedRange feedRange) { return container.getOverlappingFeedRanges(feedRange); } + + @Override + public Mono getPartitionKeyDefinition(CosmosAsyncContainer container) { + return container.getPartitionKeyDefinition(); + } + + @Override + public String getLinkWithoutTrailingSlash(CosmosAsyncContainer cosmosAsyncContainer) { + return cosmosAsyncContainer.getLinkWithoutTrailingSlash(); + } }); } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ImplementationBridgeHelpers.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ImplementationBridgeHelpers.java index bea9a78c891ba..193a5d663091e 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ImplementationBridgeHelpers.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/ImplementationBridgeHelpers.java @@ -65,6 +65,7 @@ import com.azure.cosmos.models.FeedResponse; import com.azure.cosmos.models.ModelBridgeInternal; import com.azure.cosmos.models.PartitionKey; +import com.azure.cosmos.models.PartitionKeyDefinition; import com.azure.cosmos.models.PriorityLevel; import com.azure.cosmos.models.SqlQuerySpec; import com.azure.cosmos.util.CosmosPagedFlux; @@ -180,6 +181,7 @@ public static PartitionKeyAccessor getPartitionKeyAccessor() { public interface PartitionKeyAccessor { PartitionKey toPartitionKey(PartitionKeyInternal partitionKeyInternal); + PartitionKey toPartitionKey(List values, boolean strict); } } @@ -949,8 +951,10 @@ Mono> trySplitFeedRange( FeedRange feedRange, int targetedCountAfterSplit); + String getLinkWithoutTrailingSlash(CosmosAsyncContainer cosmosAsyncContainer); Mono checkFeedRangeOverlapping(CosmosAsyncContainer container, FeedRange feedRange1, FeedRange feedRange2); Mono> getOverlappingFeedRanges(CosmosAsyncContainer container, FeedRange feedRange); + Mono getPartitionKeyDefinition(CosmosAsyncContainer container); } } diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java index e17726deaf326..798e96353477c 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RxGatewayStoreModel.java @@ -428,7 +428,7 @@ private Mono toDocumentServiceResponse(Mono> getServerAddressesViaGatewayInternalAsync(RxDocument CosmosException dce; if (!(exception instanceof CosmosException)) { // wrap in CosmosException - logger.error("Network failure", exception); + logger.warn("Network failure", exception); int statusCode = 0; if (WebExceptionUtility.isNetworkFailure(exception)) { if (WebExceptionUtility.isReadTimeoutException(exception)) { @@ -864,7 +864,7 @@ private Mono> getMasterAddressesViaGatewayAsyncInternal( CosmosException dce; if (!(exception instanceof CosmosException)) { // wrap in CosmosException - logger.error("Network failure", exception); + logger.warn("Network failure", exception); int statusCode = 0; if (WebExceptionUtility.isNetworkFailure(exception)) { if (WebExceptionUtility.isReadTimeoutException(exception)) { diff --git a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/PartitionKey.java b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/PartitionKey.java index dd0e9eb0238fd..3531cd67ffbcf 100644 --- a/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/PartitionKey.java +++ b/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/PartitionKey.java @@ -7,6 +7,8 @@ import com.azure.cosmos.implementation.Utils; import com.azure.cosmos.implementation.routing.PartitionKeyInternal; +import java.util.List; + /** * Represents a partition key value in the Azure Cosmos DB database service. A * partition key identifies the partition where the item is stored in. @@ -96,6 +98,12 @@ static void initialize() { public PartitionKey toPartitionKey(PartitionKeyInternal partitionKeyInternal) { return new PartitionKey(partitionKeyInternal); } + + @Override + public PartitionKey toPartitionKey(List values, boolean strict) { + PartitionKeyInternal partitionKeyInternal = PartitionKeyInternal.fromObjectArray(values, strict); + return new PartitionKey(partitionKeyInternal); + } } ); } diff --git a/sdk/digitaltwins/azure-digitaltwins-core/pom.xml b/sdk/digitaltwins/azure-digitaltwins-core/pom.xml index 0c2c1d0f15909..4d62d0c0a6a4d 100644 --- a/sdk/digitaltwins/azure-digitaltwins-core/pom.xml +++ b/sdk/digitaltwins/azure-digitaltwins-core/pom.xml @@ -85,6 +85,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + org.junit.jupiter junit-jupiter-api @@ -143,4 +149,21 @@ + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/documentintelligence/azure-ai-documentintelligence/pom.xml b/sdk/documentintelligence/azure-ai-documentintelligence/pom.xml index 57ccc71e79458..4f2215414655a 100644 --- a/sdk/documentintelligence/azure-ai-documentintelligence/pom.xml +++ b/sdk/documentintelligence/azure-ai-documentintelligence/pom.xml @@ -74,6 +74,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + org.junit.jupiter junit-jupiter-api @@ -99,4 +105,21 @@ test + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml b/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml index 6f2ed9a93c2e7..15deae3511dc9 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml +++ b/sdk/formrecognizer/azure-ai-formrecognizer/pom.xml @@ -73,6 +73,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + org.junit.jupiter junit-jupiter-api @@ -98,4 +104,21 @@ test + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/identity/azure-identity-broker-samples/src/samples/java/com/azure/identity/broker/JavaDocCodeSnippets.java b/sdk/identity/azure-identity-broker-samples/src/samples/java/com/azure/identity/broker/JavaDocCodeSnippets.java index b08c5b654cf4f..218505960e068 100644 --- a/sdk/identity/azure-identity-broker-samples/src/samples/java/com/azure/identity/broker/JavaDocCodeSnippets.java +++ b/sdk/identity/azure-identity-broker-samples/src/samples/java/com/azure/identity/broker/JavaDocCodeSnippets.java @@ -42,7 +42,9 @@ public void configureCredentialForWindows() { public void configureCredentialForDefaultAccount() { // BEGIN: com.azure.identity.broker.interactivebrowserbrokercredentialbuilder.useinteractivebrowserbroker.defaultaccount + long windowHandle = getWindowHandle(); // Samples below InteractiveBrowserCredential cred = new InteractiveBrowserBrokerCredentialBuilder() + .setWindowHandle(windowHandle) .useDefaultBrokerAccount() .build(); // END: com.azure.identity.broker.interactivebrowserbrokercredentialbuilder.useinteractivebrowserbroker.defaultaccount diff --git a/sdk/identity/azure-identity-broker/README.md b/sdk/identity/azure-identity-broker/README.md index f08a3d3c81279..6c5236be9a7d1 100644 --- a/sdk/identity/azure-identity-broker/README.md +++ b/sdk/identity/azure-identity-broker/README.md @@ -94,7 +94,9 @@ InteractiveBrowserCredential cred = new InteractiveBrowserBrokerCredentialBuilde When this option is enabled, the credential will attempt to silently use the default broker account. If using the default account fails, the credential will fall back to interactive authentication. ```java com.azure.identity.broker.interactivebrowserbrokercredentialbuilder.useinteractivebrowserbroker.defaultaccount +long windowHandle = getWindowHandle(); // Samples below InteractiveBrowserCredential cred = new InteractiveBrowserBrokerCredentialBuilder() + .setWindowHandle(windowHandle) .useDefaultBrokerAccount() .build(); ``` diff --git a/sdk/identity/azure-identity/README.md b/sdk/identity/azure-identity/README.md index 660aaa8ef471e..3a98cbe29b878 100644 --- a/sdk/identity/azure-identity/README.md +++ b/sdk/identity/azure-identity/README.md @@ -1,6 +1,6 @@ # Azure Identity client library for Java -The Azure Identity library provides [Microsoft Entra ID](https://learn.microsoft.com/azure/active-directory/fundamentals/active-directory-whatis) ([formerly Azure Active Directory](https://learn.microsoft.com/azure/active-directory/fundamentals/new-name)) token authentication support across the Azure SDK. It provides a set of [TokenCredential](https://learn.microsoft.com/java/api/com.azure.core.credential.tokencredential?view=azure-java-stable) implementations that can be used to construct Azure SDK clients that support Microsoft Entra token authentication. +The Azure Identity library provides [Microsoft Entra ID](https://learn.microsoft.com/entra/fundamentals/whatis) ([formerly Azure Active Directory](https://learn.microsoft.com/entra/fundamentals/new-name)) token authentication support across the Azure SDK. It provides a set of [TokenCredential](https://learn.microsoft.com/java/api/com.azure.core.credential.tokencredential?view=azure-java-stable) implementations that can be used to construct Azure SDK clients that support Microsoft Entra token authentication. [Source code][source] | [API reference documentation][javadoc] | [Microsoft Entra ID documentation][entraid_doc] @@ -187,15 +187,15 @@ public void createDefaultAzureCredentialForIntelliJ() { ## Managed Identity support -The [Managed identity authentication](https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview) is supported via either the `DefaultAzureCredential` or the `ManagedIdentityCredential` directly for the following Azure Services: +The [Managed identity authentication](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/overview) is supported via either the `DefaultAzureCredential` or the `ManagedIdentityCredential` directly for the following Azure Services: - [Azure App Service and Azure Functions](https://learn.microsoft.com/azure/app-service/overview-managed-identity?tabs=dotnet) - [Azure Arc](https://learn.microsoft.com/azure/azure-arc/servers/managed-identity-authentication) - [Azure Cloud Shell](https://learn.microsoft.com/azure/cloud-shell/msi-authorization) - [Azure Kubernetes Service](https://learn.microsoft.com/azure/aks/use-managed-identity) - [Azure Service Fabric](https://learn.microsoft.com/azure/service-fabric/concepts-managed-identity) -- [Azure Virtual Machines](https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token) -- [Azure Virtual Machines Scale Sets](https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-powershell-windows-vmss) +- [Azure Virtual Machines](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/how-to-use-vm-token) +- [Azure Virtual Machines Scale Sets](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-powershell-windows-vmss) **Note:** Use `azure-identity` version `1.7.0` or later to utilize [token caching](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity/TOKEN_CACHING.md) support for managed identity authentication. @@ -339,13 +339,13 @@ Not all credentials require this configuration. Credentials that authenticate th ClientCertificateCredential authenticates a service principal using a certificate example - Service principal authentication + Service principal authentication ClientSecretCredential authenticates a service principal using a secret example - Service principal authentication + Service principal authentication @@ -367,31 +367,31 @@ Not all credentials require this configuration. Credentials that authenticate th AuthorizationCodeCredential authenticate a user with a previously obtained authorization code as part of an Oauth 2 flow - OAuth2 authentication code + OAuth2 authentication code DeviceCodeCredential interactively authenticates a user on devices with limited UI example - Device code authentication + Device code authentication InteractiveBrowserCredential interactively authenticates a user with the default system browser example - OAuth2 authentication code + OAuth2 authentication code OnBehalfOfCredential propagates the delegated user identity and permissions through the request chain - On-behalf-of authentication + On-behalf-of authentication UsernamePasswordCredential authenticates a user with a username and password without multi-factored auth example - Username + password authentication + Username + password authentication @@ -540,7 +540,7 @@ Configuration is attempted in the above order. For example, if values for a clie ## Continuous Access Evaluation -As of v1.10.0, accessing resources protected by [Continuous Access Evaluation](https://learn.microsoft.com/azure/active-directory/conditional-access/concept-continuous-access-evaluation) (CAE) is possible on a per-request basis. This can be enabled using the [`TokenRequestContext.setCaeEnabled(boolean)` API](https://learn.microsoft.com/java/api/com.azure.core.credential.tokenrequestcontext?view=azure-java-stable#com-azure-core-credential-tokenrequestcontext-setcaeenabled(boolean)). CAE isn't supported for developer credentials. +As of v1.10.0, accessing resources protected by [Continuous Access Evaluation](https://learn.microsoft.com/entra/identity/conditional-access/concept-continuous-access-evaluation) (CAE) is possible on a per-request basis. This can be enabled using the [`TokenRequestContext.setCaeEnabled(boolean)` API](https://learn.microsoft.com/java/api/com.azure.core.credential.tokenrequestcontext?view=azure-java-stable#com-azure-core-credential-tokenrequestcontext-setcaeenabled(boolean)). CAE isn't supported for developer credentials. ## Token caching Token caching is a feature provided by the Azure Identity library that allows apps to: diff --git a/sdk/identity/azure-identity/TROUBLESHOOTING.md b/sdk/identity/azure-identity/TROUBLESHOOTING.md index 51b9636d9c6d8..163727c51ff3d 100644 --- a/sdk/identity/azure-identity/TROUBLESHOOTING.md +++ b/sdk/identity/azure-identity/TROUBLESHOOTING.md @@ -66,7 +66,7 @@ This error contains several pieces of information: - __Failing Credential Type__: The type of credential that failed to authenticate. This can be helpful when diagnosing issues with chained credential types such as `DefaultAzureCredential` or `ChainedTokenCredential`. -- __STS Error Code and Message__: The error code and message returned from the Microsoft Entra STS. This can give insight into the specific reason the request failed. For instance, in this specific case because the provided client secret is incorrect. More information on STS error codes can be found [here](https://learn.microsoft.com/azure/active-directory/develop/reference-aadsts-error-codes#aadsts-error-codes). +- __STS Error Code and Message__: The error code and message returned from the Microsoft Entra STS. This can give insight into the specific reason the request failed. For instance, in this specific case because the provided client secret is incorrect. More information on STS error codes can be found [here](https://learn.microsoft.com/entra/identity-platform/reference-error-codes#aadsts-error-codes). - __Correlation ID and Timestamp__: The correlation ID and call Timestamp used to identify the request in server-side logs. This information can be useful to support engineers when diagnosing unexpected STS failures. @@ -97,17 +97,17 @@ The underlying MSAL library, MSAL4J, also has detailed logging. It is highly ver | Error Code | Issue | Mitigation | |---|---|---| -|AADSTS7000215|An invalid client secret was provided.|Ensure the `clientSecret` provided when constructing the credential is valid. If unsure, create a new client secret using the Azure portal. Details on creating a new client secret can be found [here](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal#option-2-create-a-new-application-secret).| -|AADSTS7000222|An expired client secret was provided.|Create a new client secret using the Azure portal. Details on creating a new client secret can be found [here](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal#option-2-create-a-new-application-secret).| -|AADSTS700016|The specified application wasn't found in the specified tenant.|Ensure the specified `clientId` and `tenantId` are correct for your application registration. For multi-tenant apps, ensure the application has been added to the desired tenant by a tenant admin. To add a new application in the desired tenant, follow the instructions [here](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).| +|AADSTS7000215|An invalid client secret was provided.|Ensure the `clientSecret` provided when constructing the credential is valid. If unsure, create a new client secret using the Azure portal. Details on creating a new client secret can be found [here](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal#option-2-create-a-new-application-secret).| +|AADSTS7000222|An expired client secret was provided.|Create a new client secret using the Azure portal. Details on creating a new client secret can be found [here](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal#option-2-create-a-new-application-secret).| +|AADSTS700016|The specified application wasn't found in the specified tenant.|Ensure the specified `clientId` and `tenantId` are correct for your application registration. For multi-tenant apps, ensure the application has been added to the desired tenant by a tenant admin. To add a new application in the desired tenant, follow the instructions [here](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal).| ## Troubleshoot `ClientCertificateCredential` authentication issues `ClientAuthenticationException` | Error Code | Description | Mitigation | |---|---|---| -|AADSTS700027|Client assertion contains an invalid signature.|Ensure the specified certificate has been uploaded to the Microsoft Entra application registration. Instructions for uploading certificates to the application registration can be found [here](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal#option-1-upload-a-certificate).| -|AADSTS700016|The specified application wasn't found in the specified tenant.| Ensure the specified `clientId` and `tenantId` are correct for your application registration. For multi-tenant apps, ensure the application has been added to the desired tenant by a tenant admin. To add a new application in the desired tenant, follow the instructions [here](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).| +|AADSTS700027|Client assertion contains an invalid signature.|Ensure the specified certificate has been uploaded to the Microsoft Entra application registration. Instructions for uploading certificates to the application registration can be found [here](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal#option-1-upload-a-certificate).| +|AADSTS700016|The specified application wasn't found in the specified tenant.| Ensure the specified `clientId` and `tenantId` are correct for your application registration. For multi-tenant apps, ensure the application has been added to the desired tenant by a tenant admin. To add a new application in the desired tenant, follow the instructions [here](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal).| ## Troubleshoot `ClientAssertionCredential` authentication issues @@ -115,9 +115,9 @@ The underlying MSAL library, MSAL4J, also has detailed logging. It is highly ver | Error Code | Description | Mitigation | |---|---|---| -|AADSTS700021| Client assertion application identifier doesn't match 'client_id' parameter. Review the documentation at https://learn.microsoft.com/azure/active-directory/develop/active-directory-certificate-credentials | Ensure the JWT assertion created has the correct values specified for the `sub` and `issuer` value of the payload, both of these should have the value be equal to `clientId`. Refer documentation for [client assertion format](https://learn.microsoft.com/azure/active-directory/develop/active-directory-certificate-credentials)| -|AADSTS700023| Client assertion audience claim does not match Realm issuer. Review the documentation at https://learn.microsoft.com/azure/active-directory/develop/active-directory-certificate-credentials. | Ensure the audience `aud` field in the JWT assertion created has the correct value for the audience specified in the payload. This should be set to `https://login.microsoftonline.com/{tenantId}/v2`.| -|AADSTS50027| JWT token is invalid or malformed. | Ensure the JWT assertion token is in the valid format. Refer to the documentation for [client assertion format](https://learn.microsoft.com/azure/active-directory/develop/active-directory-certificate-credentials).| +|AADSTS700021| Client assertion application identifier doesn't match 'client_id' parameter. Review the documentation at https://learn.microsoft.com/entra/identity-platform/certificate-credentials | Ensure the JWT assertion created has the correct values specified for the `sub` and `issuer` value of the payload, both of these should have the value be equal to `clientId`. Refer documentation for [client assertion format](https://learn.microsoft.com/entra/identity-platform/certificate-credentials)| +|AADSTS700023| Client assertion audience claim does not match Realm issuer. Review the documentation at https://learn.microsoft.com/entra/identity-platform/certificate-credentials. | Ensure the audience `aud` field in the JWT assertion created has the correct value for the audience specified in the payload. This should be set to `https://login.microsoftonline.com/{tenantId}/v2`.| +|AADSTS50027| JWT token is invalid or malformed. | Ensure the JWT assertion token is in the valid format. Refer to the documentation for [client assertion format](https://learn.microsoft.com/entra/identity-platform/certificate-credentials).| ## Troubleshoot `UsernamePasswordCredential` authentication issues `ClientAuthenticationException` @@ -136,7 +136,7 @@ The `ManagedIdentityCredential` is designed to work on a variety of Azure hosts |Azure Arc|[Configuration](https://learn.microsoft.com/azure/azure-arc/servers/managed-identity-authentication)|| |Azure Kubernetes Service|[Configuration](https://azure.github.io/aad-pod-identity/docs/)|[Troubleshooting](#azure-kubernetes-service-managed-identity)| |Azure Service Fabric|[Configuration](https://learn.microsoft.com/azure/service-fabric/concepts-managed-identity)|| -|Azure Virtual Machines and Scale Sets|[Configuration](https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm)|[Troubleshooting](#azure-virtual-machine-managed-identity)| +|Azure Virtual Machines and Scale Sets|[Configuration](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm)|[Troubleshooting](#azure-virtual-machine-managed-identity)| ### Azure Virtual Machine Managed Identity @@ -144,10 +144,10 @@ The `ManagedIdentityCredential` is designed to work on a variety of Azure hosts | Error Message |Description| Mitigation | |---|---|---| -|The requested identity hasn't been assigned to this resource.|The IMDS endpoint responded with a status code of 400, indicating the requested identity isn't assigned to the VM.|If using a user assigned identity, ensure the specified `clientId` is correct.

If using a system assigned identity, make sure it has been enabled properly. Instructions to enable the system assigned identity on an Azure VM can be found [here](https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm#enable-system-assigned-managed-identity-on-an-existing-vm).| +|The requested identity hasn't been assigned to this resource.|The IMDS endpoint responded with a status code of 400, indicating the requested identity isn't assigned to the VM.|If using a user assigned identity, ensure the specified `clientId` is correct.

If using a system assigned identity, make sure it has been enabled properly. Instructions to enable the system assigned identity on an Azure VM can be found [here](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm#enable-system-assigned-managed-identity-on-an-existing-vm).| |The request failed due to a gateway error.|The request to the IMDS endpoint failed due to a gateway error, 502 or 504 status code.|Calls via proxy or gateway aren't supported by IMDS. Disable proxies or gateways running on the VM for calls to the IMDS endpoint `http://169.254.169.254/`| -|No response received from the managed identity endpoint.|No response was received for the request to IMDS or the request timed out.|

  • Ensure managed identity has been properly configured on the VM. Instructions for configuring the manged identity can be found [here](https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm).
  • Verify the IMDS endpoint is reachable on the VM, see [below](#verify-imds-is-available-on-the-vm) for instructions.
| -|Multiple attempts failed to obtain a token from the managed identity endpoint.|Retries to retrieve a token from the IMDS endpoint have been exhausted.|
  • Refer to inner exception messages for more details on specific failures. If the data has been truncated, more detail can be obtained by [collecting logs](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity/README.md#enable-client-logging).
  • Ensure managed identity has been properly configured on the VM. Instructions for configuring the manged identity can be found [here](https://learn.microsoft.com/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm).
  • Verify the IMDS endpoint is reachable on the VM, see [below](#verify-imds-is-available-on-the-vm) for instructions.
| +|No response received from the managed identity endpoint.|No response was received for the request to IMDS or the request timed out.|
  • Ensure managed identity has been properly configured on the VM. Instructions for configuring the manged identity can be found [here](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm).
  • Verify the IMDS endpoint is reachable on the VM, see [below](#verify-imds-is-available-on-the-vm) for instructions.
| +|Multiple attempts failed to obtain a token from the managed identity endpoint.|Retries to retrieve a token from the IMDS endpoint have been exhausted.|
  • Refer to inner exception messages for more details on specific failures. If the data has been truncated, more detail can be obtained by [collecting logs](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity/README.md#enable-client-logging).
  • Ensure managed identity has been properly configured on the VM. Instructions for configuring the manged identity can be found [here](https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/qs-configure-portal-windows-vm).
  • Verify the IMDS endpoint is reachable on the VM, see [below](#verify-imds-is-available-on-the-vm) for instructions.
| #### Verify IMDS is available on the VM diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/AadCredentialBuilderBase.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/AadCredentialBuilderBase.java index 19f5f26bb1713..361f7a615a9a8 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/AadCredentialBuilderBase.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/AadCredentialBuilderBase.java @@ -136,7 +136,7 @@ public T disableInstanceDiscovery() { /** * Enables additional support logging for public and confidential client applications. This enables - * PII logging in MSAL4J as described here. + * PII logging in MSAL4J as described here. * *

This operation will log PII including tokens. It should only be used when directed by support. * diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/AuthorizationCodeCredential.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/AuthorizationCodeCredential.java index 87e7ea51bd142..00c23d95f5c92 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/AuthorizationCodeCredential.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/AuthorizationCodeCredential.java @@ -22,7 +22,7 @@ /** *

Authorization Code authentication in Azure is a type of authentication mechanism that allows users to - * authenticate with Microsoft Entra ID + * authenticate with Microsoft Entra ID * and obtain an authorization code that can be used to request an access token to access * Azure resources. It is a widely used authentication mechanism and is supported by a wide range of Azure services * and applications. It provides a secure and scalable way to authenticate users and grant them access to Azure diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/AuthorizationCodeCredentialBuilder.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/AuthorizationCodeCredentialBuilder.java index e0b727cadb50e..330d04e31c64d 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/AuthorizationCodeCredentialBuilder.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/AuthorizationCodeCredentialBuilder.java @@ -13,7 +13,7 @@ *

Fluent credential builder for instantiating a {@link AuthorizationCodeCredential}.

* *

Authorization Code authentication in Azure is a type of authentication mechanism that allows users to - * authenticate with Microsoft Entra ID + * authenticate with Microsoft Entra ID * and obtain an authorization code that can be used to request an access token to access * Azure resources. It is a widely used authentication mechanism and is supported by a wide range of Azure services * and applications. It provides a secure and scalable way to authenticate users and grant them access to Azure diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzureCliCredential.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzureCliCredential.java index 56d9f0b8de541..0818a9d7b22cd 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzureCliCredential.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzureCliCredential.java @@ -20,7 +20,7 @@ * terminal. It allows users to * authenticate interactively as a * user and/or a service principal against - * Microsoft Entra ID. + * Microsoft Entra ID. * The AzureCliCredential authenticates in a development environment and acquires a token on behalf of the * logged-in user or service principal in Azure CLI. It acts as the Azure CLI logged in user or service principal * and executes an Azure CLI command underneath to authenticate the application against Microsoft Entra ID.

diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzureCliCredentialBuilder.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzureCliCredentialBuilder.java index da07d5cad70cf..d41caf547f26b 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzureCliCredentialBuilder.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzureCliCredentialBuilder.java @@ -19,7 +19,7 @@ * terminal. It allows users to * authenticate interactively as a * user and/or a service principal against - * Microsoft Entra ID. + * Microsoft Entra ID. * The AzureCliCredential authenticates in a development environment and acquires a token on behalf of the * logged-in user or service principal in Azure CLI. It acts as the Azure CLI logged in user or service principal * and executes an Azure CLI command underneath to authenticate the application against Microsoft Entra ID.

diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzureDeveloperCliCredential.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzureDeveloperCliCredential.java index f8421266a01c4..df0628d86996f 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzureDeveloperCliCredential.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzureDeveloperCliCredential.java @@ -19,7 +19,7 @@ *

Azure Developer CLI is a command-line interface tool that allows developers to create, manage, and deploy * resources in Azure. It's built on top of the Azure CLI and provides additional functionality specific * to Azure developers. It allows users to authenticate as a user and/or a service principal against - * Microsoft Entra ID. + * Microsoft Entra ID. * The AzureDeveloperCliCredential authenticates in a development environment and acquires a token on behalf of * the logged-in user or service principal in Azure Developer CLI. It acts as the Azure Developer CLI logged in user or * service principal and executes an Azure CLI command underneath to authenticate the application against diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzureDeveloperCliCredentialBuilder.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzureDeveloperCliCredentialBuilder.java index d1f3f51cf30d4..4fc66874eadc1 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzureDeveloperCliCredentialBuilder.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzureDeveloperCliCredentialBuilder.java @@ -18,7 +18,7 @@ *

Azure Developer CLI is a command-line interface tool that allows developers to create, manage, and deploy * resources in Azure. It's built on top of the Azure CLI and provides additional functionality specific * to Azure developers. It allows users to authenticate as a user and/or a service principal against - * Microsoft Entra ID. + * Microsoft Entra ID. * The AzureDeveloperCliCredential authenticates in a development environment and acquires a token on behalf of * the logged-in user or service principal in Azure Developer CLI. It acts as the Azure Developer CLI logged in user or * service principal and executes an Azure CLI command underneath to authenticate the application against diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzurePowerShellCredential.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzurePowerShellCredential.java index 16fd494da1fda..365e18fd5c0cf 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzurePowerShellCredential.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzurePowerShellCredential.java @@ -19,7 +19,7 @@ * or terminal. It allows users to * authenticate interactively * as a user and/or a service principal against - * Microsoft Entra ID. + * Microsoft Entra ID. * The AzurePowershellCredential authenticates in a development environment and acquires a token on behalf of the * logged-in user or service principal in Azure Powershell. It acts as the Azure Powershell logged in user or * service principal and executes an Azure Powershell command underneath to authenticate the application against diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzurePowerShellCredentialBuilder.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzurePowerShellCredentialBuilder.java index 5bc634f6ec944..77f431ddb19ea 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzurePowerShellCredentialBuilder.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/AzurePowerShellCredentialBuilder.java @@ -17,7 +17,7 @@ * or terminal. It allows users to * authenticate interactively * as a user and/or a service principal against - * Microsoft Entra ID. + * Microsoft Entra ID. * The {@link AzurePowerShellCredential} authenticates in a development environment and acquires a token on * behalf of the logged-in user or service principal in Azure Powershell. It acts as the Azure Powershell logged in * user or service principal and executes an Azure Powershell command underneath to authenticate the application diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientAssertionCredential.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientAssertionCredential.java index bf788fcad345a..5dd062b019c6a 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientAssertionCredential.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientAssertionCredential.java @@ -25,7 +25,7 @@ * In this authentication method, the client application creates a JSON Web Token (JWT) that includes information about * the service principal (such as its client ID and tenant ID) and signs it using a client secret. The client then * sends this token to - * Microsoft Entra ID as proof of its + * Microsoft Entra ID as proof of its * identity. Microsoft Entra ID verifies the token signature and checks that the service principal has * the necessary permissions to access the requested Azure resource. If the token is valid and the service principal is * authorized, Microsoft Entra ID issues an access token that the client application can use to access the requested resource. diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientAssertionCredentialBuilder.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientAssertionCredentialBuilder.java index 57c9744d2c6cd..2bf56a64ddc3f 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientAssertionCredentialBuilder.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientAssertionCredentialBuilder.java @@ -18,7 +18,7 @@ * In this authentication method, the client application creates a JSON Web Token (JWT) that includes information about * the service principal (such as its client ID and tenant ID) and signs it using a client secret. The client then * sends this token to - * Microsoft Entra ID as proof of its + * Microsoft Entra ID as proof of its * identity. Microsoft Entra ID verifies the token signature and checks that the service principal has * the necessary permissions to access the requested Azure resource. If the token is valid and the service principal is * authorized, Microsoft Entra ID issues an access token that the client application can use to access the requested resource. diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientCertificateCredential.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientCertificateCredential.java index 471725f45fd89..0ce162f1fa594 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientCertificateCredential.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientCertificateCredential.java @@ -21,12 +21,12 @@ /** *

The ClientCertificateCredential acquires a token via service principal authentication. It is a type of * authentication in Azure that enables a non-interactive login to - * Microsoft Entra ID, allowing + * Microsoft Entra ID, allowing * an application or service to authenticate itself with Azure resources. * A Service Principal is essentially an identity created for an application in Microsoft Entra ID that can be used to * authenticate with Azure resources. It's like a "user identity" for the application or service, and it provides * a way for the application to authenticate itself with Azure resources without needing to use a user's credentials. - * Microsoft Entra ID allows users + * Microsoft Entra ID allows users * to register service principals which can be used as an identity for authentication. * A client certificate associated with the registered service principal is used as the password when authenticating * the service principal. diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientCertificateCredentialBuilder.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientCertificateCredentialBuilder.java index 6c3337a21aa1c..523f14ca1c236 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientCertificateCredentialBuilder.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientCertificateCredentialBuilder.java @@ -15,12 +15,12 @@ * *

The ClientCertificateCredential acquires a token via service principal authentication. It is a type of * authentication in Azure that enables a non-interactive login to - * Microsoft Entra ID, allowing an + * Microsoft Entra ID, allowing an * application or service to authenticate itself with Azure resources. * A Service Principal is essentially an identity created for an application in Microsoft Entra ID that can be used to * authenticate with Azure resources. It's like a "user identity" for the application or service, and it provides * a way for the application to authenticate itself with Azure resources without needing to use a user's credentials. - * Microsoft Entra ID allows users to + * Microsoft Entra ID allows users to * register service principals which can be used as an identity for authentication. * A client certificate associated with the registered service principal is used as the password when authenticating * the service principal. diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientSecretCredential.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientSecretCredential.java index 3450e10676669..37e43a328ff17 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientSecretCredential.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientSecretCredential.java @@ -21,12 +21,12 @@ /** *

The ClientSecretCredential acquires a token via service principal authentication. It is a type of authentication * in Azure that enables a non-interactive login to - * Microsoft Entra ID, allowing an + * Microsoft Entra ID, allowing an * application or service to authenticate itself with Azure resources. * A Service Principal is essentially an identity created for an application in Microsoft Entra ID that can be used to * authenticate with Azure resources. It's like a "user identity" for the application or service, and it provides * a way for the application to authenticate itself with Azure resources without needing to use a user's credentials. - * Microsoft Entra ID allows users to + * Microsoft Entra ID allows users to * register service principals which can be used as an identity for authentication. * A client secret associated with the registered service principal is used as the password when authenticating the * service principal. diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientSecretCredentialBuilder.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientSecretCredentialBuilder.java index b77e79c032a46..b5f099d20d751 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientSecretCredentialBuilder.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/ClientSecretCredentialBuilder.java @@ -11,12 +11,12 @@ * *

The {@link ClientSecretCredential} acquires a token via service principal authentication. It is a type of * authentication in Azure that enables a non-interactive login to - * Microsoft Entra ID, allowing an + * Microsoft Entra ID, allowing an * application or service to authenticate itself with Azure resources. * A Service Principal is essentially an identity created for an application in Microsoft Entra ID that can be used to * authenticate with Azure resources. It's like a "user identity" for the application or service, and it provides * a way for the application to authenticate itself with Azure resources without needing to use a user's credentials. - * Microsoft Entra ID allows users to + * Microsoft Entra ID allows users to * register service principals which can be used as an identity for authentication. * A client secret associated with the registered service principal is used as the password when authenticating the * service principal. diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/DefaultAzureCredential.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/DefaultAzureCredential.java index 938ecd7175b2a..04dd2052e5720 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/DefaultAzureCredential.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/DefaultAzureCredential.java @@ -72,7 +72,7 @@ *

Sample: Construct DefaultAzureCredential with User Assigned Managed Identity

* *

User-Assigned Managed Identity (UAMI) in Azure is a feature that allows you to create an identity in - * Microsoft Entra ID that is + * Microsoft Entra ID that is * associated with one or more Azure resources. This identity can then be used to authenticate and * authorize access to various Azure services and resources. The following code sample demonstrates the creation of * a DefaultAzureCredential to target a user assigned managed identity, using the diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/DefaultAzureCredentialBuilder.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/DefaultAzureCredentialBuilder.java index 56c15539aa095..40c2193924f3e 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/DefaultAzureCredentialBuilder.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/DefaultAzureCredentialBuilder.java @@ -43,7 +43,7 @@ *

Sample: Construct DefaultAzureCredential with User Assigned Managed Identity

* *

User-Assigned Managed Identity (UAMI) in Azure is a feature that allows you to create an identity in - * Microsoft Entra ID that is + * Microsoft Entra ID that is * associated with one or more Azure resources. This identity can then be used to authenticate and * authorize access to various Azure services and resources. The following code sample demonstrates the creation of * a {@link DefaultAzureCredential} to target a user assigned managed identity, using the DefaultAzureCredentialBuilder diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/DeviceCodeCredential.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/DeviceCodeCredential.java index 60fb3819f6917..281e96eab17f0 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/DeviceCodeCredential.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/DeviceCodeCredential.java @@ -22,7 +22,7 @@ /** *

Device code authentication is a type of authentication flow offered by - * Microsoft Entra ID that + * Microsoft Entra ID that * allows users to sign in to applications on devices that don't have a web browser or a keyboard. * This authentication method is particularly useful for devices such as smart TVs, gaming consoles, and * Internet of Things (IoT) devices that may not have the capability to enter a username and password. diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/DeviceCodeCredentialBuilder.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/DeviceCodeCredentialBuilder.java index 47b61f240490f..051a8fd03af4b 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/DeviceCodeCredentialBuilder.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/DeviceCodeCredentialBuilder.java @@ -15,7 +15,7 @@ * Fluent credential builder for instantiating a {@link DeviceCodeCredential}. * *

Device code authentication is a type of authentication flow offered by - * Microsoft Entra ID that + * Microsoft Entra ID that * allows users to sign in to applications on devices that don't have a web browser or a keyboard. * This authentication method is particularly useful for devices such as smart TVs, gaming consoles, and * Internet of Things (IoT) devices that may not have the capability to enter a username and password. diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/IntelliJCredential.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/IntelliJCredential.java index da6fa2e039679..73785dbf6c26e 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/IntelliJCredential.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/IntelliJCredential.java @@ -28,7 +28,7 @@ * for IntelliJ plugin for the IntelliJ IDEA development environment. It * enables developers to create, test, and deploy Java applications to the Azure cloud platform. In order to * use the plugin authentication as a user or service principal against - * Microsoft Entra ID is required. + * Microsoft Entra ID is required. * The IntelliJCredential authenticates in a development environment and acquires a token on behalf of the * logged-in account in Azure Toolkit for IntelliJ. It uses the logged in user information on the IntelliJ IDE and uses * it to authenticate the application against Microsoft Entra ID.

diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/IntelliJCredentialBuilder.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/IntelliJCredentialBuilder.java index 1bb985361ddfc..f19677c4432e2 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/IntelliJCredentialBuilder.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/IntelliJCredentialBuilder.java @@ -20,7 +20,7 @@ * for IntelliJ plugin for the IntelliJ IDEA development environment. It enables developers to create, test, and * deploy Java applications to the Azure cloud platform. In order to use the plugin authentication as a user or * service principal against - * Microsoft Entra ID is required. + * Microsoft Entra ID is required. * The {@link IntelliJCredential} authenticates in a development environment and acquires a token on behalf of the * logged-in account in Azure Toolkit for IntelliJ. It uses the logged in user information on the IntelliJ IDE and uses * it to authenticate the application against Microsoft Entra ID.

diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/InteractiveBrowserCredential.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/InteractiveBrowserCredential.java index 7d759b93e0e21..ed1212233330a 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/InteractiveBrowserCredential.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/InteractiveBrowserCredential.java @@ -21,7 +21,7 @@ /** *

Interactive browser authentication is a type of authentication flow offered by - * Microsoft Entra ID + * Microsoft Entra ID * that enables users to sign in to applications and services using a web browser. This authentication method is * commonly used for web applications, where users enter their credentials directly into a web page. * With interactive browser authentication, the user navigates to a web application and is prompted to enter their diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/InteractiveBrowserCredentialBuilder.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/InteractiveBrowserCredentialBuilder.java index 33cd7966217bf..1b13ff9c7cdd6 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/InteractiveBrowserCredentialBuilder.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/InteractiveBrowserCredentialBuilder.java @@ -16,7 +16,7 @@ * Fluent credential builder for instantiating a {@link InteractiveBrowserCredential}. * *

Interactive browser authentication is a type of authentication flow offered by - * Microsoft Entra ID + * Microsoft Entra ID * that enables users to sign in to applications and services using a web browser. This authentication method is * commonly used for web applications, where users enter their credentials directly into a web page. * With interactive browser authentication, the user navigates to a web application and is prompted to enter their diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/ManagedIdentityCredential.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/ManagedIdentityCredential.java index 3b9b27d1b9f72..22201b8c8778a 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/ManagedIdentityCredential.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/ManagedIdentityCredential.java @@ -19,9 +19,9 @@ import java.time.Duration; /** - *

Azure + *

Azure * Managed Identity is a feature in - * Microsoft Entra ID + * Microsoft Entra ID * that provides a way for applications running on Azure to authenticate themselves with Azure resources without * needing to manage or store any secrets like passwords or keys. * The ManagedIdentityCredential authenticates the configured managed identity (system or user assigned) of an @@ -62,7 +62,7 @@ *

Sample: Construct a User Assigned ManagedIdentityCredential

* *

User-Assigned Managed Identity (UAMI) in Azure is a feature that allows you to create an identity in - * Microsoft Entra ID + * Microsoft Entra ID * that is associated with one or more Azure resources. This identity can then be * used to authenticate and authorize access to various Azure services and resources. The following code sample * demonstrates the creation of a ManagedIdentityCredential to target a user assigned managed identity, using the diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/ManagedIdentityCredentialBuilder.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/ManagedIdentityCredentialBuilder.java index 6d6b57ed66fea..1fa8f853c6215 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/ManagedIdentityCredentialBuilder.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/ManagedIdentityCredentialBuilder.java @@ -8,9 +8,9 @@ /** *

Fluent credential builder for instantiating a {@link ManagedIdentityCredential}.

* - *

Azure + *

Azure * Managed Identity is a feature in - * Microsoft Entra ID + * Microsoft Entra ID * that provides a way for applications running on Azure to authenticate themselves with Azure resources without * needing to manage or store any secrets like passwords or keys. * The {@link ManagedIdentityCredential} authenticates the configured managed identity (system or user assigned) of an @@ -36,7 +36,7 @@ *

Sample: Construct a User Assigned ManagedIdentityCredential

* *

User-Assigned Managed Identity (UAMI) in Azure is a feature that allows you to create an identity in - * Microsoft Entra ID + * Microsoft Entra ID * that is associated with one or more Azure resources. This identity can then be used to authenticate and * authorize access to various Azure services and resources. The following code sample demonstrates the creation of a * {@link ManagedIdentityCredential} to target a user assigned managed identity, using the diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/UsernamePasswordCredential.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/UsernamePasswordCredential.java index cfad0d11b1194..24d8645c6e4e0 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/UsernamePasswordCredential.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/UsernamePasswordCredential.java @@ -22,7 +22,7 @@ /** *

Username password authentication is a common type of authentication flow used by many applications and services, - * including Microsoft Entra ID. + * including Microsoft Entra ID. * With username password authentication, users enter their username and password credentials to sign * in to an application or service. * The UsernamePasswordCredential authenticates a public client application and acquires a token using the diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/UsernamePasswordCredentialBuilder.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/UsernamePasswordCredentialBuilder.java index efddd8327f65d..a273855fd8005 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/UsernamePasswordCredentialBuilder.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/UsernamePasswordCredentialBuilder.java @@ -14,7 +14,7 @@ * Fluent credential builder for instantiating a {@link UsernamePasswordCredential}. * *

Username password authentication is a common type of authentication flow used by many applications and services, - * including Microsoft Entra ID. + * including Microsoft Entra ID. * With username password authentication, users enter their username and password credentials to sign * in to an application or service. * The {@link UsernamePasswordCredential} authenticates a public client application and acquires a token using the diff --git a/sdk/identity/azure-identity/src/main/java/com/azure/identity/package-info.java b/sdk/identity/azure-identity/src/main/java/com/azure/identity/package-info.java index 985ea4dd706cf..f3ab5e6949b3a 100644 --- a/sdk/identity/azure-identity/src/main/java/com/azure/identity/package-info.java +++ b/sdk/identity/azure-identity/src/main/java/com/azure/identity/package-info.java @@ -3,7 +3,7 @@ /** *

The Azure Identity library provides - * Microsoft Entra ID token + * Microsoft Entra ID token * authentication support across the * Azure SDK. The library focuses on * OAuth authentication with Microsoft Entra ID, and it offers various credential classes capable of acquiring a Microsoft Entra token @@ -120,9 +120,9 @@ * *

Authenticating on Azure Hosted Platforms via Managed Identity

* - *

Azure + *

Azure * Managed Identity is a feature in - * Microsoft Entra ID + * Microsoft Entra ID * that provides a way for applications running on Azure to authenticate themselves with Azure resources without * needing to manage or store any secrets like passwords or keys.

* @@ -192,12 +192,12 @@ *

Authenticate with Service Principals

* *

Service Principal authentication is a type of authentication in Azure that enables a non-interactive login to - * Microsoft Entra ID, allowing an + * Microsoft Entra ID, allowing an * application or service to authenticate itself with Azure resources. * A Service Principal is essentially an identity created for an application in Microsoft Entra ID that can be used to * authenticate with Azure resources. It's like a "user identity" for the application or service, and it provides * a way for the application to authenticate itself with Azure resources without needing to use a user's credentials. - * Microsoft Entra ID allows users to + * Microsoft Entra ID allows users to * register service principals which can be used as an identity for authentication. * A client secret and/or a client certificate associated with the registered service principal is used as the password * when authenticating the service principal.

@@ -269,7 +269,7 @@ * *

User credential authentication is a type of authentication in Azure that involves a user providing their * username and password to authenticate with Azure resources. In Azure, user credential authentication can be used to - * authenticate with Microsoft Entra ID.

+ * authenticate with Microsoft Entra ID.

* *

The Azure Identity library supports user credentials based authentication via * {@link com.azure.identity.InteractiveBrowserCredential}, {@link com.azure.identity.DeviceCodeCredential} and diff --git a/sdk/keyvault/azure-security-keyvault-administration/pom.xml b/sdk/keyvault/azure-security-keyvault-administration/pom.xml index 7cc8340b504c8..4b9aec1e70dcf 100644 --- a/sdk/keyvault/azure-security-keyvault-administration/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-administration/pom.xml @@ -103,6 +103,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-security-keyvault-keys @@ -122,4 +128,21 @@ test + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/keyvault/azure-security-keyvault-certificates/pom.xml b/sdk/keyvault/azure-security-keyvault-certificates/pom.xml index c9a9907557599..62d134f066421 100644 --- a/sdk/keyvault/azure-security-keyvault-certificates/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-certificates/pom.xml @@ -98,6 +98,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-identity @@ -138,4 +144,21 @@ + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/keyvault/azure-security-keyvault-keys/pom.xml b/sdk/keyvault/azure-security-keyvault-keys/pom.xml index 0c0458d0b0ecb..8bab779e35e93 100644 --- a/sdk/keyvault/azure-security-keyvault-keys/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-keys/pom.xml @@ -102,6 +102,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-identity @@ -123,4 +129,21 @@ test + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/keyvault/azure-security-keyvault-secrets/pom.xml b/sdk/keyvault/azure-security-keyvault-secrets/pom.xml index af2e1baee6438..72de3404b5599 100644 --- a/sdk/keyvault/azure-security-keyvault-secrets/pom.xml +++ b/sdk/keyvault/azure-security-keyvault-secrets/pom.xml @@ -68,6 +68,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + org.junit.jupiter junit-jupiter-api @@ -114,4 +120,21 @@ test + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/maps/azure-maps-elevation/pom.xml b/sdk/maps/azure-maps-elevation/pom.xml index 9848b47c7e36d..12fec3ccdb963 100644 --- a/sdk/maps/azure-maps-elevation/pom.xml +++ b/sdk/maps/azure-maps-elevation/pom.xml @@ -64,6 +64,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-identity @@ -101,4 +107,21 @@ test + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/maps/azure-maps-geolocation/pom.xml b/sdk/maps/azure-maps-geolocation/pom.xml index 23b09858ac127..d98ffa1b79812 100644 --- a/sdk/maps/azure-maps-geolocation/pom.xml +++ b/sdk/maps/azure-maps-geolocation/pom.xml @@ -68,6 +68,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-identity @@ -105,4 +111,21 @@ test + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/maps/azure-maps-render/pom.xml b/sdk/maps/azure-maps-render/pom.xml index 3d4e7164a1bd7..8a9072d8c1713 100644 --- a/sdk/maps/azure-maps-render/pom.xml +++ b/sdk/maps/azure-maps-render/pom.xml @@ -77,6 +77,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-identity @@ -114,4 +120,21 @@ test + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/maps/azure-maps-route/pom.xml b/sdk/maps/azure-maps-route/pom.xml index 219a1f1330409..d6686feee86f5 100644 --- a/sdk/maps/azure-maps-route/pom.xml +++ b/sdk/maps/azure-maps-route/pom.xml @@ -77,6 +77,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-identity @@ -120,4 +126,21 @@ test + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/maps/azure-maps-search/pom.xml b/sdk/maps/azure-maps-search/pom.xml index 9bd1b2edd105d..5262610de9994 100644 --- a/sdk/maps/azure-maps-search/pom.xml +++ b/sdk/maps/azure-maps-search/pom.xml @@ -78,6 +78,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-identity @@ -115,4 +121,21 @@ test + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/maps/azure-maps-timezone/pom.xml b/sdk/maps/azure-maps-timezone/pom.xml index 4c4b5e2eaaecf..15eed78a98d58 100644 --- a/sdk/maps/azure-maps-timezone/pom.xml +++ b/sdk/maps/azure-maps-timezone/pom.xml @@ -74,6 +74,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-identity @@ -111,4 +117,21 @@ test + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/maps/azure-maps-traffic/pom.xml b/sdk/maps/azure-maps-traffic/pom.xml index 177c33248fd59..e4fb67655a947 100644 --- a/sdk/maps/azure-maps-traffic/pom.xml +++ b/sdk/maps/azure-maps-traffic/pom.xml @@ -65,6 +65,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-identity @@ -102,4 +108,21 @@ test + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/maps/azure-maps-weather/pom.xml b/sdk/maps/azure-maps-weather/pom.xml index d46fec7ee3bcc..49a6e6a25008f 100644 --- a/sdk/maps/azure-maps-weather/pom.xml +++ b/sdk/maps/azure-maps-weather/pom.xml @@ -75,6 +75,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-identity @@ -112,4 +118,21 @@ test + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/metricsadvisor/azure-ai-metricsadvisor/pom.xml b/sdk/metricsadvisor/azure-ai-metricsadvisor/pom.xml index a67f389a77c6e..bb33b112ea9ad 100644 --- a/sdk/metricsadvisor/azure-ai-metricsadvisor/pom.xml +++ b/sdk/metricsadvisor/azure-ai-metricsadvisor/pom.xml @@ -71,6 +71,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + org.junit.jupiter junit-jupiter-api @@ -96,4 +102,21 @@ test + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/mixedreality/azure-mixedreality-authentication/pom.xml b/sdk/mixedreality/azure-mixedreality-authentication/pom.xml index 2f45b30461680..36748a677ab52 100644 --- a/sdk/mixedreality/azure-mixedreality-authentication/pom.xml +++ b/sdk/mixedreality/azure-mixedreality-authentication/pom.xml @@ -55,6 +55,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + org.junit.jupiter junit-jupiter-api @@ -102,4 +108,21 @@ + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/modelsrepository/azure-iot-modelsrepository/pom.xml b/sdk/modelsrepository/azure-iot-modelsrepository/pom.xml index 885eefb52fd97..24213dcc7c860 100644 --- a/sdk/modelsrepository/azure-iot-modelsrepository/pom.xml +++ b/sdk/modelsrepository/azure-iot-modelsrepository/pom.xml @@ -73,6 +73,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + org.junit.jupiter junit-jupiter-api @@ -131,4 +137,21 @@ + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/monitor/azure-monitor-ingestion/CHANGELOG.md b/sdk/monitor/azure-monitor-ingestion/CHANGELOG.md index 53d412567e5e5..30a74593c1f25 100644 --- a/sdk/monitor/azure-monitor-ingestion/CHANGELOG.md +++ b/sdk/monitor/azure-monitor-ingestion/CHANGELOG.md @@ -4,6 +4,9 @@ ### Features Added +- Introduced `LogsIngestionAudience` to allow specification of the audience of logs ingestion clients. +- Support for the scopes of non-public clouds. + ### Breaking Changes ### Bugs Fixed diff --git a/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/LogsIngestionClientBuilder.java b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/LogsIngestionClientBuilder.java index 9d27d086e59c7..071e0eb274d3c 100644 --- a/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/LogsIngestionClientBuilder.java +++ b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/LogsIngestionClientBuilder.java @@ -20,6 +20,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.monitor.ingestion.implementation.IngestionUsingDataCollectionRulesClientBuilder; import com.azure.monitor.ingestion.implementation.IngestionUsingDataCollectionRulesServiceVersion; +import com.azure.monitor.ingestion.models.LogsIngestionAudience; import java.net.MalformedURLException; import java.net.URL; @@ -171,6 +172,19 @@ public LogsIngestionClientBuilder credential(TokenCredential tokenCredential) { return this; } + + /** + * Sets the audience for the authorization scope of log ingestion clients. If this value is not set, the default + * audience will be the azure public cloud. + * + * @param audience the audience value. + * @return the updated {@link LogsIngestionClientBuilder}. + */ + public LogsIngestionClientBuilder audience(LogsIngestionAudience audience) { + innerLogBuilder.audience(audience); + return this; + } + /** * {@inheritDoc} */ diff --git a/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesAsyncClient.java b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesAsyncClient.java index 736c735ca2e4e..6410374635f80 100644 --- a/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesAsyncClient.java +++ b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesAsyncClient.java @@ -17,14 +17,17 @@ import com.azure.core.util.BinaryData; import reactor.core.publisher.Mono; -/** Initializes a new instance of the asynchronous IngestionUsingDataCollectionRulesClient type. */ +/** + * Initializes a new instance of the asynchronous IngestionUsingDataCollectionRulesClient type. + */ @ServiceClient(builder = IngestionUsingDataCollectionRulesClientBuilder.class, isAsync = true) public final class IngestionUsingDataCollectionRulesAsyncClient { - @Generated private final IngestionUsingDataCollectionRulesClientImpl serviceClient; + @Generated + private final IngestionUsingDataCollectionRulesClientImpl serviceClient; /** * Initializes an instance of IngestionUsingDataCollectionRulesAsyncClient class. - * + * * @param serviceClient the service client implementation. */ @Generated @@ -34,28 +37,23 @@ public final class IngestionUsingDataCollectionRulesAsyncClient { /** * Ingestion API used to directly ingest data using Data Collection Rules - * - *

See error response code and error response message for more detail. - * - *

Header Parameters - * + * + * See error response code and error response message for more detail. + *

Header Parameters

* * * * * *
Header Parameters
NameTypeRequiredDescription
Content-EncodingStringNogzip
x-ms-client-request-idStringNoClient request Id
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Request Body Schema - * + *

Request Body Schema

*
{@code
      * [
      *     Object (Required)
      * ]
      * }
- * + * * @param ruleId The immutable Id of the Data Collection Rule resource. * @param stream The streamDeclaration name as defined in the Data Collection Rule. * @param body An array of objects matching the schema defined by the provided stream. @@ -68,8 +66,8 @@ public final class IngestionUsingDataCollectionRulesAsyncClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadWithResponse( - String ruleId, String stream, BinaryData body, RequestOptions requestOptions) { + public Mono> uploadWithResponse(String ruleId, String stream, BinaryData body, + RequestOptions requestOptions) { return this.serviceClient.uploadWithResponseAsync(ruleId, stream, body, requestOptions); } } diff --git a/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesClient.java b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesClient.java index 4fe8cb55eb44b..9af4b9ba8ed33 100644 --- a/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesClient.java +++ b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesClient.java @@ -16,45 +16,43 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; -/** Initializes a new instance of the synchronous IngestionUsingDataCollectionRulesClient type. */ +/** + * Initializes a new instance of the synchronous IngestionUsingDataCollectionRulesClient type. + */ @ServiceClient(builder = IngestionUsingDataCollectionRulesClientBuilder.class) public final class IngestionUsingDataCollectionRulesClient { - @Generated private final IngestionUsingDataCollectionRulesClientImpl serviceClient; + @Generated + private final IngestionUsingDataCollectionRulesClientImpl serviceClient; /** * Initializes an instance of IngestionUsingDataCollectionRulesClient class. - * - * @param client the async client. + * + * @param serviceClient the service client implementation. */ @Generated - IngestionUsingDataCollectionRulesClient(IngestionUsingDataCollectionRulesClientImpl client) { - this.serviceClient = client; + IngestionUsingDataCollectionRulesClient(IngestionUsingDataCollectionRulesClientImpl serviceClient) { + this.serviceClient = serviceClient; } /** * Ingestion API used to directly ingest data using Data Collection Rules - * - *

See error response code and error response message for more detail. - * - *

Header Parameters - * + * + * See error response code and error response message for more detail. + *

Header Parameters

* * * * * *
Header Parameters
NameTypeRequiredDescription
Content-EncodingStringNogzip
x-ms-client-request-idStringNoClient request Id
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Request Body Schema - * + *

Request Body Schema

*
{@code
      * [
      *     Object (Required)
      * ]
      * }
- * + * * @param ruleId The immutable Id of the Data Collection Rule resource. * @param stream The streamDeclaration name as defined in the Data Collection Rule. * @param body An array of objects matching the schema defined by the provided stream. @@ -67,8 +65,8 @@ public final class IngestionUsingDataCollectionRulesClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadWithResponse( - String ruleId, String stream, BinaryData body, RequestOptions requestOptions) { + public Response uploadWithResponse(String ruleId, String stream, BinaryData body, + RequestOptions requestOptions) { return this.serviceClient.uploadWithResponse(ruleId, stream, body, requestOptions); } } diff --git a/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesClientBuilder.java b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesClientBuilder.java index fba9adabadcf0..e42664a704975 100644 --- a/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesClientBuilder.java +++ b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesClientBuilder.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. - package com.azure.monitor.ingestion.implementation; +import com.azure.monitor.ingestion.models.LogsIngestionAudience; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.client.traits.ConfigurationTrait; @@ -12,6 +12,7 @@ import com.azure.core.client.traits.TokenCredentialTrait; import com.azure.core.credential.TokenCredential; import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; @@ -20,9 +21,8 @@ import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.AddHeadersPolicy; import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; @@ -33,36 +33,44 @@ import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.serializer.JacksonAdapter; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.stream.Collectors; -/** A builder for creating a new instance of the IngestionUsingDataCollectionRulesClient type. */ +/** + * A builder for creating a new instance of the IngestionUsingDataCollectionRulesClient type. + */ @ServiceClientBuilder( - serviceClients = { - IngestionUsingDataCollectionRulesClient.class, - IngestionUsingDataCollectionRulesAsyncClient.class - }) + serviceClients = { + IngestionUsingDataCollectionRulesClient.class, + IngestionUsingDataCollectionRulesAsyncClient.class }) public final class IngestionUsingDataCollectionRulesClientBuilder - implements HttpTrait, - ConfigurationTrait, - TokenCredentialTrait, - EndpointTrait { - @Generated private static final String SDK_NAME = "name"; + implements HttpTrait, + ConfigurationTrait, + TokenCredentialTrait, + EndpointTrait { - @Generated private static final String SDK_VERSION = "version"; + @Generated + private static final String SDK_NAME = "name"; - @Generated private static final String[] DEFAULT_SCOPES = new String[] {"https://monitor.azure.com//.default"}; + @Generated + private static final String SDK_VERSION = "version"; + + @Generated + private static final String[] DEFAULT_SCOPES = new String[] { "https://monitor.azure.com//.default" }; @Generated private static final Map PROPERTIES = CoreUtils.getProperties("azure-monitor-ingestion.properties"); - @Generated private final List pipelinePolicies; + @Generated + private final List pipelinePolicies; - /** Create an instance of the IngestionUsingDataCollectionRulesClientBuilder. */ + /** + * Create an instance of the IngestionUsingDataCollectionRulesClientBuilder. + */ @Generated public IngestionUsingDataCollectionRulesClientBuilder() { this.pipelinePolicies = new ArrayList<>(); @@ -71,12 +79,18 @@ public IngestionUsingDataCollectionRulesClientBuilder() { /* * The HTTP pipeline to send requests through. */ - @Generated private HttpPipeline pipeline; + @Generated + private HttpPipeline pipeline; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public IngestionUsingDataCollectionRulesClientBuilder pipeline(HttpPipeline pipeline) { + if (this.pipeline != null && pipeline == null) { + LOGGER.info("HttpPipeline is being set to 'null' when it was previously configured."); + } this.pipeline = pipeline; return this; } @@ -84,9 +98,12 @@ public IngestionUsingDataCollectionRulesClientBuilder pipeline(HttpPipeline pipe /* * The HTTP client used to send the request. */ - @Generated private HttpClient httpClient; + @Generated + private HttpClient httpClient; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public IngestionUsingDataCollectionRulesClientBuilder httpClient(HttpClient httpClient) { @@ -97,9 +114,12 @@ public IngestionUsingDataCollectionRulesClientBuilder httpClient(HttpClient http /* * The logging configuration for HTTP requests and responses. */ - @Generated private HttpLogOptions httpLogOptions; + @Generated + private HttpLogOptions httpLogOptions; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public IngestionUsingDataCollectionRulesClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { @@ -110,9 +130,12 @@ public IngestionUsingDataCollectionRulesClientBuilder httpLogOptions(HttpLogOpti /* * The client options such as application ID and custom headers to set on a request. */ - @Generated private ClientOptions clientOptions; + @Generated + private ClientOptions clientOptions; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public IngestionUsingDataCollectionRulesClientBuilder clientOptions(ClientOptions clientOptions) { @@ -123,9 +146,12 @@ public IngestionUsingDataCollectionRulesClientBuilder clientOptions(ClientOption /* * The retry options to configure retry policy for failed requests. */ - @Generated private RetryOptions retryOptions; + @Generated + private RetryOptions retryOptions; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public IngestionUsingDataCollectionRulesClientBuilder retryOptions(RetryOptions retryOptions) { @@ -133,7 +159,9 @@ public IngestionUsingDataCollectionRulesClientBuilder retryOptions(RetryOptions return this; } - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public IngestionUsingDataCollectionRulesClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { @@ -145,9 +173,12 @@ public IngestionUsingDataCollectionRulesClientBuilder addPolicy(HttpPipelinePoli /* * The configuration store that is used during construction of the service client. */ - @Generated private Configuration configuration; + @Generated + private Configuration configuration; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public IngestionUsingDataCollectionRulesClientBuilder configuration(Configuration configuration) { @@ -158,9 +189,12 @@ public IngestionUsingDataCollectionRulesClientBuilder configuration(Configuratio /* * The TokenCredential used for authentication. */ - @Generated private TokenCredential tokenCredential; + @Generated + private TokenCredential tokenCredential; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public IngestionUsingDataCollectionRulesClientBuilder credential(TokenCredential tokenCredential) { @@ -171,9 +205,12 @@ public IngestionUsingDataCollectionRulesClientBuilder credential(TokenCredential /* * The service endpoint */ - @Generated private String endpoint; + @Generated + private String endpoint; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public IngestionUsingDataCollectionRulesClientBuilder endpoint(String endpoint) { @@ -184,7 +221,8 @@ public IngestionUsingDataCollectionRulesClientBuilder endpoint(String endpoint) /* * Service version */ - @Generated private IngestionUsingDataCollectionRulesServiceVersion serviceVersion; + @Generated + private IngestionUsingDataCollectionRulesServiceVersion serviceVersion; /** * Sets Service version. @@ -193,8 +231,8 @@ public IngestionUsingDataCollectionRulesClientBuilder endpoint(String endpoint) * @return the IngestionUsingDataCollectionRulesClientBuilder. */ @Generated - public IngestionUsingDataCollectionRulesClientBuilder serviceVersion( - IngestionUsingDataCollectionRulesServiceVersion serviceVersion) { + public IngestionUsingDataCollectionRulesClientBuilder + serviceVersion(IngestionUsingDataCollectionRulesServiceVersion serviceVersion) { this.serviceVersion = serviceVersion; return this; } @@ -202,7 +240,8 @@ public IngestionUsingDataCollectionRulesClientBuilder serviceVersion( /* * The retry policy that will attempt to retry failed requests, if applicable. */ - @Generated private RetryPolicy retryPolicy; + @Generated + private RetryPolicy retryPolicy; /** * Sets The retry policy that will attempt to retry failed requests, if applicable. @@ -224,18 +263,17 @@ public IngestionUsingDataCollectionRulesClientBuilder retryPolicy(RetryPolicy re @Generated private IngestionUsingDataCollectionRulesClientImpl buildInnerClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - IngestionUsingDataCollectionRulesServiceVersion localServiceVersion = - (serviceVersion != null) ? serviceVersion : IngestionUsingDataCollectionRulesServiceVersion.getLatest(); - IngestionUsingDataCollectionRulesClientImpl client = - new IngestionUsingDataCollectionRulesClientImpl( - localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, localServiceVersion); + IngestionUsingDataCollectionRulesServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : IngestionUsingDataCollectionRulesServiceVersion.getLatest(); + IngestionUsingDataCollectionRulesClientImpl client = new IngestionUsingDataCollectionRulesClientImpl( + localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); return client; } @Generated private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration = - (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + Configuration buildConfiguration + = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; List policies = new ArrayList<>(); @@ -246,33 +284,30 @@ private HttpPipeline createHttpPipeline() { policies.add(new RequestIdPolicy()); policies.add(new AddHeadersFromContextPolicy()); HttpHeaders headers = new HttpHeaders(); - localClientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue())); + localClientOptions.getHeaders() + .forEach(header -> headers.set(HttpHeaderName.fromString(header.getName()), header.getValue())); if (headers.getSize() > 0) { policies.add(new AddHeadersPolicy(headers)); } - policies.addAll( - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .forEach(p -> policies.add(p)); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); policies.add(new AddDatePolicy()); - policies.add(new CookiePolicy()); if (tokenCredential != null) { - policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, + audience == null ? DEFAULT_SCOPES : new String[] { audience.toString() })); } - policies.addAll( - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(localClientOptions) + .build(); return httpPipeline; } @@ -293,7 +328,26 @@ public IngestionUsingDataCollectionRulesAsyncClient buildAsyncClient() { */ @Generated public IngestionUsingDataCollectionRulesClient buildClient() { - return new IngestionUsingDataCollectionRulesClient( - buildInnerClient()); + return new IngestionUsingDataCollectionRulesClient(buildInnerClient()); + } + + private static final ClientLogger LOGGER = new ClientLogger(IngestionUsingDataCollectionRulesClientBuilder.class); + + /** + * The audience indicating the authorization scope of log ingestion clients. + */ + @Generated() + private LogsIngestionAudience audience; + + /** + * Sets The audience. + * + * @param audience the audience indicating the authorization scope of log ingestion clients. + * @return the IngestionUsingDataCollectionRulesClientBuilder. + */ + @Generated() + public IngestionUsingDataCollectionRulesClientBuilder audience(LogsIngestionAudience audience) { + this.audience = audience; + return this; } } diff --git a/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesClientImpl.java b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesClientImpl.java index f563f013c9cd8..0ae66b24f53ae 100644 --- a/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesClientImpl.java +++ b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesClientImpl.java @@ -22,7 +22,6 @@ import com.azure.core.exception.ResourceNotFoundException; 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.http.rest.RequestOptions; @@ -36,57 +35,65 @@ import com.azure.core.util.serializer.SerializerAdapter; import reactor.core.publisher.Mono; -/** Initializes a new instance of the IngestionUsingDataCollectionRulesClient type. */ +/** + * Initializes a new instance of the IngestionUsingDataCollectionRulesClient type. + */ public final class IngestionUsingDataCollectionRulesClientImpl { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final IngestionUsingDataCollectionRulesClientService service; /** - * The Data Collection Endpoint for the Data Collection Rule, for example - * https://dce-name.eastus-2.ingest.monitor.azure.com. + * The Data Collection Endpoint for the Data Collection Rule, for example https://dce-name.eastus-2.ingest.monitor.azure.com. */ private final String endpoint; /** - * Gets The Data Collection Endpoint for the Data Collection Rule, for example - * https://dce-name.eastus-2.ingest.monitor.azure.com. - * + * Gets The Data Collection Endpoint for the Data Collection Rule, for example https://dce-name.eastus-2.ingest.monitor.azure.com. + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** Service version. */ + /** + * Service version. + */ private final IngestionUsingDataCollectionRulesServiceVersion serviceVersion; /** * Gets Service version. - * + * * @return the serviceVersion value. */ public IngestionUsingDataCollectionRulesServiceVersion getServiceVersion() { return this.serviceVersion; } - /** The HTTP pipeline to send requests through. */ + /** + * 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. */ + /** + * 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. */ public SerializerAdapter getSerializerAdapter() { @@ -95,138 +102,94 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of IngestionUsingDataCollectionRulesClient client. - * - * @param endpoint The Data Collection Endpoint for the Data Collection Rule, for example - * https://dce-name.eastus-2.ingest.monitor.azure.com. + * + * @param endpoint The Data Collection Endpoint for the Data Collection Rule, for example https://dce-name.eastus-2.ingest.monitor.azure.com. * @param serviceVersion Service version. */ - public IngestionUsingDataCollectionRulesClientImpl( - String endpoint, IngestionUsingDataCollectionRulesServiceVersion serviceVersion) { - this( - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(), - JacksonAdapter.createDefaultSerializerAdapter(), - endpoint, - serviceVersion); + IngestionUsingDataCollectionRulesClientImpl(String endpoint, + IngestionUsingDataCollectionRulesServiceVersion serviceVersion) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** * Initializes an instance of IngestionUsingDataCollectionRulesClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. - * @param endpoint The Data Collection Endpoint for the Data Collection Rule, for example - * https://dce-name.eastus-2.ingest.monitor.azure.com. + * @param endpoint The Data Collection Endpoint for the Data Collection Rule, for example https://dce-name.eastus-2.ingest.monitor.azure.com. * @param serviceVersion Service version. */ - public IngestionUsingDataCollectionRulesClientImpl( - HttpPipeline httpPipeline, - String endpoint, + IngestionUsingDataCollectionRulesClientImpl(HttpPipeline httpPipeline, String endpoint, IngestionUsingDataCollectionRulesServiceVersion serviceVersion) { this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** * Initializes an instance of IngestionUsingDataCollectionRulesClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param endpoint The Data Collection Endpoint for the Data Collection Rule, for example - * https://dce-name.eastus-2.ingest.monitor.azure.com. + * @param endpoint The Data Collection Endpoint for the Data Collection Rule, for example https://dce-name.eastus-2.ingest.monitor.azure.com. * @param serviceVersion Service version. */ - public IngestionUsingDataCollectionRulesClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - String endpoint, - IngestionUsingDataCollectionRulesServiceVersion serviceVersion) { + IngestionUsingDataCollectionRulesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + String endpoint, IngestionUsingDataCollectionRulesServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; this.serviceVersion = serviceVersion; - this.service = - RestProxy.create( - IngestionUsingDataCollectionRulesClientService.class, - this.httpPipeline, - this.getSerializerAdapter()); + this.service = RestProxy.create(IngestionUsingDataCollectionRulesClientService.class, this.httpPipeline, + this.getSerializerAdapter()); } /** - * The interface defining all the services for IngestionUsingDataCollectionRulesClient to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for IngestionUsingDataCollectionRulesClient to be used by the proxy service to perform REST calls. */ @Host("{endpoint}") @ServiceInterface(name = "IngestionUsingDataCo") public interface IngestionUsingDataCollectionRulesClientService { @Post("/dataCollectionRules/{ruleId}/streams/{stream}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> upload( - @HostParam("endpoint") String endpoint, - @PathParam("ruleId") String ruleId, - @PathParam("stream") String stream, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData body, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); + Mono> upload(@HostParam("endpoint") String endpoint, @PathParam("ruleId") String ruleId, + @PathParam("stream") String stream, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BinaryData body, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Post("/dataCollectionRules/{ruleId}/streams/{stream}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response uploadSync( - @HostParam("endpoint") String endpoint, - @PathParam("ruleId") String ruleId, - @PathParam("stream") String stream, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") BinaryData body, - @HeaderParam("Accept") String accept, - RequestOptions requestOptions, - Context context); + Response uploadSync(@HostParam("endpoint") String endpoint, @PathParam("ruleId") String ruleId, + @PathParam("stream") String stream, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") BinaryData body, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); } /** * Ingestion API used to directly ingest data using Data Collection Rules - * - *

See error response code and error response message for more detail. - * - *

Header Parameters - * + * + * See error response code and error response message for more detail. + *

Header Parameters

* * * * * *
Header Parameters
NameTypeRequiredDescription
Content-EncodingStringNogzip
x-ms-client-request-idStringNoClient request Id
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Request Body Schema - * + *

Request Body Schema

*
{@code
      * [
      *     Object (Required)
      * ]
      * }
- * + * * @param ruleId The immutable Id of the Data Collection Rule resource. * @param stream The streamDeclaration name as defined in the Data Collection Rule. * @param body An array of objects matching the schema defined by the provided stream. @@ -238,58 +201,44 @@ Response uploadSync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadWithResponseAsync( - String ruleId, String stream, BinaryData body, RequestOptions requestOptions) { + public Mono> uploadWithResponseAsync(String ruleId, String stream, BinaryData body, + RequestOptions requestOptions) { if (ruleId == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); } if (stream == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Parameter stream is required and cannot be null.")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Parameter stream is required and cannot be null.")); } if (body == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Parameter body is required and cannot be null.")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Parameter body is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.upload( - this.getEndpoint(), - ruleId, - stream, - this.getServiceVersion().getVersion(), - body, - accept, - requestOptions, - context)); + return FluxUtil.withContext(context -> service.upload(this.getEndpoint(), ruleId, stream, + this.getServiceVersion().getVersion(), body, accept, requestOptions, context)); } /** * Ingestion API used to directly ingest data using Data Collection Rules - * - *

See error response code and error response message for more detail. - * - *

Header Parameters - * + * + * See error response code and error response message for more detail. + *

Header Parameters

* * * * * *
Header Parameters
NameTypeRequiredDescription
Content-EncodingStringNogzip
x-ms-client-request-idStringNoClient request Id
- * * You can add these to a request with {@link RequestOptions#addHeader} - * - *

Request Body Schema - * + *

Request Body Schema

*
{@code
      * [
      *     Object (Required)
      * ]
      * }
- * + * * @param ruleId The immutable Id of the Data Collection Rule resource. * @param stream The streamDeclaration name as defined in the Data Collection Rule. * @param body An array of objects matching the schema defined by the provided stream. @@ -301,30 +250,23 @@ public Mono> uploadWithResponseAsync( * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadWithResponse( - String ruleId, String stream, BinaryData body, RequestOptions requestOptions) { + public Response uploadWithResponse(String ruleId, String stream, BinaryData body, + RequestOptions requestOptions) { if (ruleId == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); } if (stream == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Parameter stream is required and cannot be null.")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Parameter stream is required and cannot be null.")); } if (body == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Parameter body is required and cannot be null.")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("Parameter body is required and cannot be null.")); } final String accept = "application/json"; - return service.uploadSync( - this.getEndpoint(), - ruleId, - stream, - this.getServiceVersion().getVersion(), - body, - accept, - requestOptions, - requestOptions.getContext()); + return service.uploadSync(this.getEndpoint(), ruleId, stream, this.getServiceVersion().getVersion(), body, + accept, requestOptions, Context.NONE); } private static final ClientLogger LOGGER = new ClientLogger(IngestionUsingDataCollectionRulesClientImpl.class); diff --git a/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesServiceVersion.java b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesServiceVersion.java index 706e1f3a03402..1a6e5ef84d752 100644 --- a/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesServiceVersion.java +++ b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/IngestionUsingDataCollectionRulesServiceVersion.java @@ -6,9 +6,13 @@ import com.azure.core.util.ServiceVersion; -/** Service version of IngestionUsingDataCollectionRulesClient. */ +/** + * Service version of IngestionUsingDataCollectionRulesClient. + */ public enum IngestionUsingDataCollectionRulesServiceVersion implements ServiceVersion { - /** Enum value 2023-01-01. */ + /** + * Enum value 2023-01-01. + */ V2023_01_01("2023-01-01"); private final String version; @@ -17,7 +21,9 @@ public enum IngestionUsingDataCollectionRulesServiceVersion implements ServiceVe this.version = version; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public String getVersion() { return this.version; @@ -25,7 +31,7 @@ public String getVersion() { /** * Gets the latest service version supported by this client library. - * + * * @return The latest {@link IngestionUsingDataCollectionRulesServiceVersion}. */ public static IngestionUsingDataCollectionRulesServiceVersion getLatest() { diff --git a/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/package-info.java b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/package-info.java index f4ceffac4b6b5..e7584cdc91ee6 100644 --- a/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/package-info.java +++ b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the classes for IngestionUsingDataCollectionRules. null. */ +/** + * Package containing the classes for IngestionUsingDataCollectionRules. + * null. + */ package com.azure.monitor.ingestion.implementation; diff --git a/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/models/LogsIngestionAudience.java b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/models/LogsIngestionAudience.java new file mode 100644 index 0000000000000..4b3ed2c370b97 --- /dev/null +++ b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/models/LogsIngestionAudience.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.monitor.ingestion.models; + +import com.azure.core.util.ExpandableStringEnum; + +import java.util.Collection; + +/** + * The audience indicating the authorization scope of log ingestion clients. + */ +public class LogsIngestionAudience extends ExpandableStringEnum { + + /** + * Static value for Azure Public Cloud. + */ + public static final LogsIngestionAudience AZURE_PUBLIC_CLOUD = fromString("https://monitor.azure.com//.default"); + + /** + * Static value for Azure US Government. + */ + private static final LogsIngestionAudience AZURE_GOVERNMENT = fromString("https://monitor.azure.us//.default"); + + /** + * Static value for Azure China. + */ + private static final LogsIngestionAudience AZURE_CHINA = fromString("https://monitor.azure.cn//.default"); + + /** + * @deprecated Creates an instance of LogsIngestionAudience. + */ + @Deprecated + LogsIngestionAudience() { + } + + /** + * Creates an instance of LogsIngestionAudience. + * + * @param name the string value. + * @return the LogsIngestionAudience. + */ + public static LogsIngestionAudience fromString(String name) { + return fromString(name, LogsIngestionAudience.class); + } + + /** + * Get the collection of LogsIngestionAudience values. + * + * @return the collection of LogsIngestionAudience values. + */ + public static Collection values() { + return values(LogsIngestionAudience.class); + } + +} diff --git a/sdk/monitor/azure-monitor-ingestion/src/main/java/module-info.java b/sdk/monitor/azure-monitor-ingestion/src/main/java/module-info.java index d392257ae5dd0..2b4903531d628 100644 --- a/sdk/monitor/azure-monitor-ingestion/src/main/java/module-info.java +++ b/sdk/monitor/azure-monitor-ingestion/src/main/java/module-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. module com.azure.monitor.ingestion { requires transitive com.azure.core; - exports com.azure.monitor.ingestion; exports com.azure.monitor.ingestion.models; diff --git a/sdk/monitor/azure-monitor-ingestion/swagger/README.md b/sdk/monitor/azure-monitor-ingestion/swagger/README.md index 4610d90a08391..b42ec32ab9824 100644 --- a/sdk/monitor/azure-monitor-ingestion/swagger/README.md +++ b/sdk/monitor/azure-monitor-ingestion/swagger/README.md @@ -2,13 +2,19 @@ ## Code generation settings +### Manual Modifications + +The following edits need to be made manually after code generation: +- Rollback the edits to `module-info` file + ```yaml java: true -use: '@autorest/java@4.1.9' +use: '@autorest/java@4.26.2' output-folder: ../ license-header: MICROSOFT_MIT_SMALL input-file: https://github.com/Azure/azure-rest-api-specs/blob/main/specification/monitor/data-plane/ingestion/stable/2023-01-01/DataCollectionRules.json namespace: com.azure.monitor.ingestion.implementation +implementation-subpackage: "" generate-client-interfaces: false sync-methods: all add-context-parameter: true @@ -21,4 +27,5 @@ client-side-validations: true artifact-id: azure-monitor-ingestion data-plane: true enable-sync-stack: true +customization-class: src/main/java/MonitorIngestionCustomizations.java ``` diff --git a/sdk/monitor/azure-monitor-ingestion/swagger/pom.xml b/sdk/monitor/azure-monitor-ingestion/swagger/pom.xml new file mode 100644 index 0000000000000..8876e3dcaf2d0 --- /dev/null +++ b/sdk/monitor/azure-monitor-ingestion/swagger/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + Microsoft Azure Monitor Ingestion client for Java + This package contains client functionality for Microsoft Monitor Ingestion + + com.azure.tools + azure-monitor-ingestion-autorest-customization + 1.0.0-beta.1 + jar + + + com.azure + azure-code-customization-parent + 1.0.0-beta.1 + ../../../parents/azure-code-customization-parent + + + + + com.azure.tools + azure-autorest-customization + 1.0.0-beta.8 + + + + diff --git a/sdk/monitor/azure-monitor-ingestion/swagger/src/main/java/MonitorIngestionCustomizations.java b/sdk/monitor/azure-monitor-ingestion/swagger/src/main/java/MonitorIngestionCustomizations.java new file mode 100644 index 0000000000000..fec434fbc6470 --- /dev/null +++ b/sdk/monitor/azure-monitor-ingestion/swagger/src/main/java/MonitorIngestionCustomizations.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import com.azure.autorest.customization.ClassCustomization; +import com.azure.autorest.customization.Customization; +import com.azure.autorest.customization.LibraryCustomization; +import com.azure.autorest.customization.PackageCustomization; +import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration; +import com.github.javaparser.ast.body.TypeDeclaration; +import com.github.javaparser.ast.stmt.BlockStmt; +import org.slf4j.Logger; + +import java.util.function.Consumer; + +/** + * Customization class for Monitor. These customizations will be applied on top of the generated code. + */ +public class MonitorIngestionCustomizations extends Customization { + + /** + * Customizes the generated code. + * + *
+ * + * The following customizations are applied: + * + *
    + *
  1. The package customization for the package `com.azure.monitor.ingestion.implementation`.
  2. + *
+ * + * @param libraryCustomization The library customization. + * @param logger The logger. + */ + @Override + public void customize(LibraryCustomization libraryCustomization, Logger logger) { + monitorIngestionImplementation(libraryCustomization.getPackage("com.azure.monitor.ingestion.implementation"), logger); + } + + /** + * Customizes the generated code for the package com.azure.monitor.ingestion.implementation. + * + *
+ * + * The following classes are customized: + *
    + *
  1. IngestionUsingDataCollectionRulesClientBuilder
  2. + *
+ * + * @param packageCustomization The package customization. + * @param logger The logger. + */ + private void monitorIngestionImplementation(PackageCustomization packageCustomization, Logger logger) { + IngestionUsingDataCollectionRulesClientBuilderCustomization(packageCustomization.getClass("IngestionUsingDataCollectionRulesClientBuilder"), logger); + } + + /** + * Customizes the generated code for `IngestionUsingDataCollectionRulesClientBuilder`. + * + *
+ * + * The following customizations are applied: + * + *
    + *
  1. Adds an import statement for the class `LogsIngestionAudience`.
  2. + *
  3. Adds a field `audience` of type `LogsIngestionAudience` to the class.
  4. + *
  5. Adds a Javadoc for the field `audience`.
  6. + *
  7. Adds the generated annotation to the field `audience`.
  8. + *
  9. Adds a setter for the field `audience`.
  10. + *
  11. Adds a Javadoc for the setter.
  12. + *
  13. Adds the generated annotation to the setter.
  14. + *
  15. Replaces the body of the method `createHttpPipeline()` with a custom implementation that sets the + * audience in the `BearerTokenAuthenticationPolicy`.
  16. + *
+ * + * @param classCustomization The class customization. + * @param logger The logger. + */ + private void IngestionUsingDataCollectionRulesClientBuilderCustomization(ClassCustomization classCustomization, Logger logger) { + classCustomization.addImports("com.azure.monitor.ingestion.models.LogsIngestionAudience"); + + + + customizeAst(classCustomization, clazz -> { + clazz.addPrivateField("LogsIngestionAudience", "audience") + .addAnnotation("Generated") + .setJavadocComment("The audience indicating the authorization scope of log ingestion clients.") + .createSetter() + .setName("audience") + .setType("IngestionUsingDataCollectionRulesClientBuilder") + .setBody(new BlockStmt() + .addStatement("this.audience = audience;") + .addStatement("return this;")) + .addAnnotation("Generated") + .setJavadocComment("Sets The audience.\n" + + " *\n" + + " * @param audience the audience indicating the authorization scope of log ingestion clients.\n" + + " * @return the IngestionUsingDataCollectionRulesClientBuilder."); + }); + + + classCustomization.getMethod("createHttpPipeline").replaceBody("Configuration buildConfiguration\n" + + " = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration;\n" + + " HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions;\n" + + " ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions;\n" + + " List policies = new ArrayList<>();\n" + + " String clientName = PROPERTIES.getOrDefault(SDK_NAME, \"UnknownName\");\n" + + " String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, \"UnknownVersion\");\n" + + " String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions);\n" + + " policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration));\n" + + " policies.add(new RequestIdPolicy());\n" + + " policies.add(new AddHeadersFromContextPolicy());\n" + + " HttpHeaders headers = new HttpHeaders();\n" + + " localClientOptions.getHeaders()\n" + + " .forEach(header -> headers.set(HttpHeaderName.fromString(header.getName()), header.getValue()));\n" + + " if (headers.getSize() > 0) {\n" + + " policies.add(new AddHeadersPolicy(headers));\n" + + " }\n" + + " this.pipelinePolicies.stream()\n" + + " .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)\n" + + " .forEach(p -> policies.add(p));\n" + + " HttpPolicyProviders.addBeforeRetryPolicies(policies);\n" + + " policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy()));\n" + + " policies.add(new AddDatePolicy());\n" + + " if (tokenCredential != null) {\n" + + " policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, audience == null ? DEFAULT_SCOPES : new String[] { audience.toString() }));\n" + + " }\n" + + " this.pipelinePolicies.stream()\n" + + " .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)\n" + + " .forEach(p -> policies.add(p));\n" + + " HttpPolicyProviders.addAfterRetryPolicies(policies);\n" + + " policies.add(new HttpLoggingPolicy(localHttpLogOptions));\n" + + " HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0]))\n" + + " .httpClient(httpClient)\n" + + " .clientOptions(localClientOptions)\n" + + " .build();\n" + + " return httpPipeline;"); + + } + + + /** + * Customizes the abstract syntax tree of a class. + * @param classCustomization The class customization. + * @param consumer The consumer. + */ + private static void customizeAst(ClassCustomization classCustomization, Consumer consumer) { + classCustomization.customizeAst(ast -> consumer.accept(ast.getClassByName(classCustomization.getClassName()) + .orElseThrow(() -> new RuntimeException("Class not found. " + classCustomization.getClassName())))); + } +} diff --git a/sdk/monitor/azure-monitor-query-perf/pom.xml b/sdk/monitor/azure-monitor-query-perf/pom.xml index 796f03fd124c7..e40ac8ae211c8 100644 --- a/sdk/monitor/azure-monitor-query-perf/pom.xml +++ b/sdk/monitor/azure-monitor-query-perf/pom.xml @@ -31,7 +31,7 @@ com.azure azure-monitor-query - 1.3.0-beta.3 + 1.4.0-beta.1 com.azure diff --git a/sdk/monitor/azure-monitor-query/CHANGELOG.md b/sdk/monitor/azure-monitor-query/CHANGELOG.md index 4502c7202cbfe..8232947998b2f 100644 --- a/sdk/monitor/azure-monitor-query/CHANGELOG.md +++ b/sdk/monitor/azure-monitor-query/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.3.0-beta.3 (Unreleased) +## 1.4.0-beta.1 (Unreleased) ### Features Added @@ -8,11 +8,18 @@ ### Bugs Fixed -- Fixed the issue with `MetricsQueryClient` and `MetricsQueryAsyncClient` where the `listMetricDefinitions` method was returning -`MetricsDefinition` objects with null values for `supportedAggregationTypes`.[(#36698)](https://github.com/Azure/azure-sdk-for-java/issues/36698) - ### Other Changes +## 1.3.0 (2024-03-26) + +### Features Added + +- Added `MetricsClient` and `MetricsAsyncClient` to support querying metrics for multiple resources in a single request. + +### Bugs Fixed + +- Fixed the issue with `MetricsQueryClient` and `MetricsQueryAsyncClient` where the `listMetricDefinitions` method was returning +`MetricsDefinition` objects with null values for `supportedAggregationTypes`.[(#36698)](https://github.com/Azure/azure-sdk-for-java/issues/36698) ## 1.2.10 (2024-03-20) @@ -23,7 +30,6 @@ - Upgraded `azure-core` from `1.46.0` to version `1.47.0`. - Upgraded `azure-core-http-netty` from `1.14.0` to version `1.14.1`. - ## 1.2.9 (2024-02-20) ### Other Changes diff --git a/sdk/monitor/azure-monitor-query/README.md b/sdk/monitor/azure-monitor-query/README.md index e506e2f9c2cc0..c186fc3caeee2 100644 --- a/sdk/monitor/azure-monitor-query/README.md +++ b/sdk/monitor/azure-monitor-query/README.md @@ -66,7 +66,7 @@ add the direct dependency to your project as follows. com.azure azure-monitor-query - 1.3.0-beta.2 + 1.3.0 ``` diff --git a/sdk/monitor/azure-monitor-query/pom.xml b/sdk/monitor/azure-monitor-query/pom.xml index f053812ffff10..3a1ff8146fc49 100644 --- a/sdk/monitor/azure-monitor-query/pom.xml +++ b/sdk/monitor/azure-monitor-query/pom.xml @@ -11,7 +11,7 @@ com.azure azure-monitor-query - 1.3.0-beta.3 + 1.4.0-beta.1 Microsoft Azure SDK for Azure Monitor Logs and Metrics Query This package contains the Microsoft Azure SDK for querying Azure Monitor's Logs and Metrics data sources. diff --git a/sdk/openai/azure-ai-openai-assistants/pom.xml b/sdk/openai/azure-ai-openai-assistants/pom.xml index 323f817c260f8..4153c4ef59974 100644 --- a/sdk/openai/azure-ai-openai-assistants/pom.xml +++ b/sdk/openai/azure-ai-openai-assistants/pom.xml @@ -92,6 +92,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + @@ -127,4 +133,21 @@ test + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/openai/azure-ai-openai/pom.xml b/sdk/openai/azure-ai-openai/pom.xml index 64b678f710147..24e47a0eced92 100644 --- a/sdk/openai/azure-ai-openai/pom.xml +++ b/sdk/openai/azure-ai-openai/pom.xml @@ -95,14 +95,18 @@ 1.7.36 test - com.azure azure-core-http-okhttp 1.11.19 test - + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.knuddels jtokkit @@ -130,4 +134,21 @@ test + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/personalizer/azure-ai-personalizer/pom.xml b/sdk/personalizer/azure-ai-personalizer/pom.xml index 3c85f55a30986..5b2b0aec0c453 100644 --- a/sdk/personalizer/azure-ai-personalizer/pom.xml +++ b/sdk/personalizer/azure-ai-personalizer/pom.xml @@ -70,6 +70,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + org.junit.jupiter junit-jupiter-api @@ -95,4 +101,21 @@ test + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/remoterendering/azure-mixedreality-remoterendering/assets.json b/sdk/remoterendering/azure-mixedreality-remoterendering/assets.json index 248f3dbe9f3e8..97bec81035630 100644 --- a/sdk/remoterendering/azure-mixedreality-remoterendering/assets.json +++ b/sdk/remoterendering/azure-mixedreality-remoterendering/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/remoterendering/azure-mixedreality-remoterendering", - "Tag": "java/remoterendering/azure-mixedreality-remoterendering_24a8dbb81a" + "Tag": "java/remoterendering/azure-mixedreality-remoterendering_2fbd5a57df" } diff --git a/sdk/remoterendering/azure-mixedreality-remoterendering/pom.xml b/sdk/remoterendering/azure-mixedreality-remoterendering/pom.xml index 730dcb99022fd..bac6e2e6bbf08 100644 --- a/sdk/remoterendering/azure-mixedreality-remoterendering/pom.xml +++ b/sdk/remoterendering/azure-mixedreality-remoterendering/pom.xml @@ -52,6 +52,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + org.junit.jupiter junit-jupiter-api @@ -89,4 +95,20 @@ test + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/remoterendering/azure-mixedreality-remoterendering/src/test/java/com/azure/mixedreality/remoterendering/RemoteRenderingAsyncClientTest.java b/sdk/remoterendering/azure-mixedreality-remoterendering/src/test/java/com/azure/mixedreality/remoterendering/RemoteRenderingAsyncClientTest.java index 65a6fc7ac6d18..dec2e83187211 100644 --- a/sdk/remoterendering/azure-mixedreality-remoterendering/src/test/java/com/azure/mixedreality/remoterendering/RemoteRenderingAsyncClientTest.java +++ b/sdk/remoterendering/azure-mixedreality-remoterendering/src/test/java/com/azure/mixedreality/remoterendering/RemoteRenderingAsyncClientTest.java @@ -146,9 +146,10 @@ public void failedConversionMissingAssetTest(HttpClient httpClient) { assertEquals(AssetConversionStatus.FAILED, conversion.getStatus()); assertNotNull(conversion.getError()); - // Invalid input provided. Check logs in output container for details. - assertTrue(conversion.getError().getMessage().toLowerCase(Locale.ROOT).contains("invalid input")); - assertTrue(conversion.getError().getMessage().toLowerCase(Locale.ROOT).contains("logs")); + assertEquals(conversion.getError().getCode(), "InputContainerError"); + // Message: "Could not find the asset file in the storage account. Please make sure all paths and names are correct and the file is uploaded to storage." + assertNotNull(conversion.getError().getMessage()); + assertTrue(conversion.getError().getMessage().toLowerCase(Locale.ROOT).contains("could not find the asset file in the storage account")); }) .verifyComplete(); } diff --git a/sdk/remoterendering/azure-mixedreality-remoterendering/src/test/java/com/azure/mixedreality/remoterendering/RemoteRenderingClientTest.java b/sdk/remoterendering/azure-mixedreality-remoterendering/src/test/java/com/azure/mixedreality/remoterendering/RemoteRenderingClientTest.java index 3676fe54f862a..b37bab4df0118 100644 --- a/sdk/remoterendering/azure-mixedreality-remoterendering/src/test/java/com/azure/mixedreality/remoterendering/RemoteRenderingClientTest.java +++ b/sdk/remoterendering/azure-mixedreality-remoterendering/src/test/java/com/azure/mixedreality/remoterendering/RemoteRenderingClientTest.java @@ -126,9 +126,10 @@ public void failedConversionMissingAssetTest(HttpClient httpClient) { assertEquals(AssetConversionStatus.FAILED, conversion.getStatus()); assertNotNull(conversion.getError()); - // Invalid input provided. Check logs in output container for details. - assertTrue(conversion.getError().getMessage().toLowerCase(Locale.ROOT).contains("invalid input")); - assertTrue(conversion.getError().getMessage().toLowerCase(Locale.ROOT).contains("logs")); + assertEquals(conversion.getError().getCode(), "InputContainerError"); + // Message: "Could not find the asset file in the storage account. Please make sure all paths and names are correct and the file is uploaded to storage." + assertNotNull(conversion.getError().getMessage()); + assertTrue(conversion.getError().getMessage().toLowerCase(Locale.ROOT).contains("could not find the asset file in the storage account")); } @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) diff --git a/sdk/remoterendering/azure-mixedreality-remoterendering/src/test/java/com/azure/mixedreality/remoterendering/RemoteRenderingTestBase.java b/sdk/remoterendering/azure-mixedreality-remoterendering/src/test/java/com/azure/mixedreality/remoterendering/RemoteRenderingTestBase.java index 2765aaaa29546..208a9329d6407 100644 --- a/sdk/remoterendering/azure-mixedreality-remoterendering/src/test/java/com/azure/mixedreality/remoterendering/RemoteRenderingTestBase.java +++ b/sdk/remoterendering/azure-mixedreality-remoterendering/src/test/java/com/azure/mixedreality/remoterendering/RemoteRenderingTestBase.java @@ -41,7 +41,7 @@ public class RemoteRenderingTestBase extends TestProxyTestBase { private final String serviceEndpoint = Configuration.getGlobalConfiguration().get("REMOTERENDERING_ARR_SERVICE_ENDPOINT"); // NOT REAL ACCOUNT DETAILS - private final String playbackAccountId = "f5b3e69f-1e1b-46a5-a718-aea58a7a0f8e"; + private final String playbackAccountId = "40831821-9a8b-4f81-b85f-018809a1f727"; private final String playbackAccountDomain = "mixedreality.azure.com"; private final String playbackAccountKey = "Sanitized"; private final String playbackStorageAccountName = "sdkTest"; diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/CHANGELOG.md b/sdk/resourcemanager/azure-resourcemanager-appservice/CHANGELOG.md index e4998ea24fbaf..bb6e4fab7148a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/CHANGELOG.md +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/CHANGELOG.md @@ -4,6 +4,8 @@ ### Features Added +- Supported disabling public network access in `WebApp` via `disablePublicNetworkAccess()`, for private link feature. + ### Breaking Changes ### Bugs Fixed diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/assets.json b/sdk/resourcemanager/azure-resourcemanager-appservice/assets.json index 6c164a5492b81..24e51a5b338b5 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/assets.json +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/resourcemanager/azure-resourcemanager-appservice", - "Tag": "java/resourcemanager/azure-resourcemanager-appservice_c5279701f3" + "Tag": "java/resourcemanager/azure-resourcemanager-appservice_6d9bee9aaa" } diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppBaseImpl.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppBaseImpl.java index babd6545ca00d..129ae6436e414 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppBaseImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/WebAppBaseImpl.java @@ -43,6 +43,7 @@ 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.PublicNetworkAccess; import com.azure.resourcemanager.appservice.models.PythonVersion; import com.azure.resourcemanager.appservice.models.RedundancyMode; import com.azure.resourcemanager.appservice.models.RemoteVisualStudioVersion; @@ -1835,6 +1836,31 @@ public FluentImplT withoutIpAddressRangeAccess(String ipAddressCidr) { return (FluentImplT) this; } + @Override + @SuppressWarnings("unchecked") + public FluentImplT enablePublicNetworkAccess() { + if (Objects.isNull(this.siteConfig)) { + this.siteConfig = new SiteConfigResourceInner(); + } + this.siteConfig.withPublicNetworkAccess("Enabled"); + return (FluentImplT) this; + } + + @Override + @SuppressWarnings("unchecked") + public FluentImplT disablePublicNetworkAccess() { + if (Objects.isNull(this.siteConfig)) { + this.siteConfig = new SiteConfigResourceInner(); + } + this.siteConfig.withPublicNetworkAccess("Disabled"); + return (FluentImplT) this; + } + + @Override + public PublicNetworkAccess publicNetworkAccess() { + return Objects.isNull(innerModel().publicNetworkAccess()) ? null : PublicNetworkAccess.fromString(innerModel().publicNetworkAccess()); + } + @Override @SuppressWarnings("unchecked") public FluentImplT withContainerSize(int containerSize) { diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PublicNetworkAccess.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PublicNetworkAccess.java new file mode 100644 index 0000000000000..d93b630f80b89 --- /dev/null +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/PublicNetworkAccess.java @@ -0,0 +1,53 @@ +// 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; + +/** + * Whether requests from Public Network are allowed. + */ +public final class PublicNetworkAccess extends ExpandableStringEnum { + /** + * Static value Enabled for PublicNetworkAccess. + */ + public static final PublicNetworkAccess ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for PublicNetworkAccess. + */ + public static final PublicNetworkAccess DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of PublicNetworkAccess value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PublicNetworkAccess() { + } + + /** + * Creates or finds a PublicNetworkAccess from its string representation. + * + * @param name a name to look for. + * @return the corresponding PublicNetworkAccess. + */ + @JsonCreator + public static PublicNetworkAccess fromString(String name) { + return fromString(name, PublicNetworkAccess.class); + } + + /** + * Gets known PublicNetworkAccess values. + * + * @return known PublicNetworkAccess values. + */ + public static Collection values() { + return values(PublicNetworkAccess.class); + } +} diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppBase.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppBase.java index 976fb50f74fb1..e3ec0b71638fa 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppBase.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/WebAppBase.java @@ -203,6 +203,13 @@ public interface WebAppBase extends HasName, GroupableResource streamAllLogsAsync(); + /** + * Whether the web app can be accessed from public network. + * + * @return whether the web app can be accessed from public network. + */ + PublicNetworkAccess publicNetworkAccess(); + /** * Verifies the ownership of the domain for a certificate order by verifying a hostname of the domain is bound to * this web app. @@ -940,6 +947,13 @@ interface WithNetworkAccess { * @return the next stage of the definition */ WithCreate withAccessRule(IpSecurityRestriction ipSecurityRule); + + /** + * Disables public network access for the web app. + * + * @return the next stage of the definition + */ + WithCreate disablePublicNetworkAccess(); } /** The stage of web app definition allowing to configure container size. */ @@ -1665,6 +1679,19 @@ interface WithNetworkAccess { * @return the next stage of the update */ Update withoutIpAddressRangeAccess(String ipAddressCidr); + + /** + * Enables public network access for the web app, for private link feature. + * + * @return the next stage of the update + */ + Update enablePublicNetworkAccess(); + /** + * Disables public network access for the web app, for private link feature. + * + * @return the next stage of the update + */ + Update disablePublicNetworkAccess(); } /** The stage of web app update allowing to configure container size. */ diff --git a/sdk/resourcemanager/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/WebAppsTests.java b/sdk/resourcemanager/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/WebAppsTests.java index 2f5c914515944..77b2abbaff1fc 100644 --- a/sdk/resourcemanager/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/WebAppsTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-appservice/src/test/java/com/azure/resourcemanager/appservice/WebAppsTests.java @@ -15,6 +15,7 @@ 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.PublicNetworkAccess; import com.azure.resourcemanager.appservice.models.PricingTier; import com.azure.resourcemanager.appservice.models.RemoteVisualStudioVersion; import com.azure.resourcemanager.appservice.models.WebApp; @@ -284,4 +285,45 @@ public void canUpdateIpRestriction() { Assertions.assertEquals("Allow", webApp1.ipSecurityRules().iterator().next().action()); Assertions.assertEquals("Any", webApp1.ipSecurityRules().iterator().next().ipAddress()); } + + @Test + public void canCreateWebAppWithDisablePublicNetworkAccess() { + resourceManager.resourceGroups().define(rgName1).withRegion(Region.US_WEST).create(); + resourceManager.resourceGroups().define(rgName2).withRegion(Region.US_WEST).create(); + WebApp webApp = + appServiceManager + .webApps() + .define(webappName1) + .withRegion(Region.US_WEST) + .withExistingResourceGroup(rgName1) + .withNewWindowsPlan(appServicePlanName1, PricingTier.BASIC_B1) + .disablePublicNetworkAccess() + .withRemoteDebuggingEnabled(RemoteVisualStudioVersion.VS2019) + .create(); + webApp.refresh(); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, webApp.publicNetworkAccess()); + } + + @Test + public void canUpdatePublicNetworkAccess() { + resourceManager.resourceGroups().define(rgName1).withRegion(Region.US_WEST).create(); + resourceManager.resourceGroups().define(rgName2).withRegion(Region.US_WEST).create(); + WebApp webApp = + appServiceManager + .webApps() + .define(webappName1) + .withRegion(Region.US_WEST) + .withExistingResourceGroup(rgName1) + .withNewWindowsPlan(appServicePlanName1, PricingTier.BASIC_B1) + .withRemoteDebuggingEnabled(RemoteVisualStudioVersion.VS2019) + .create(); + + webApp.update().disablePublicNetworkAccess().apply(); + webApp.refresh(); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, webApp.publicNetworkAccess()); + + webApp.update().enablePublicNetworkAccess().apply(); + webApp.refresh(); + Assertions.assertEquals(PublicNetworkAccess.ENABLED, webApp.publicNetworkAccess()); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-containerservice/CHANGELOG.md b/sdk/resourcemanager/azure-resourcemanager-containerservice/CHANGELOG.md index c0c3ae05a6493..c15bb1757023b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-containerservice/CHANGELOG.md +++ b/sdk/resourcemanager/azure-resourcemanager-containerservice/CHANGELOG.md @@ -4,6 +4,8 @@ ### Features Added +- Supported disabling public network access in `KubernetesCluster` via `disablePublicNetworkAccess()`, for private link feature. + ### Breaking Changes ### Bugs Fixed diff --git a/sdk/resourcemanager/azure-resourcemanager-containerservice/assets.json b/sdk/resourcemanager/azure-resourcemanager-containerservice/assets.json index 885ec95ce7313..7ec4d96adc784 100644 --- a/sdk/resourcemanager/azure-resourcemanager-containerservice/assets.json +++ b/sdk/resourcemanager/azure-resourcemanager-containerservice/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/resourcemanager/azure-resourcemanager-containerservice", - "Tag": "java/resourcemanager/azure-resourcemanager-containerservice_93dbce086c" + "Tag": "java/resourcemanager/azure-resourcemanager-containerservice_bb2ea4e1ac" } diff --git a/sdk/resourcemanager/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/KubernetesClusterImpl.java b/sdk/resourcemanager/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/KubernetesClusterImpl.java index da99dfb18ca82..e1a65a2f47883 100644 --- a/sdk/resourcemanager/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/KubernetesClusterImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/KubernetesClusterImpl.java @@ -40,6 +40,7 @@ import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuName; import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier; import com.azure.resourcemanager.containerservice.models.PowerState; +import com.azure.resourcemanager.containerservice.models.PublicNetworkAccess; import com.azure.resourcemanager.containerservice.models.ResourceIdentityType; import com.azure.resourcemanager.containerservice.models.UserAssignedIdentity; import com.azure.resourcemanager.resources.fluentcore.arm.models.PrivateEndpoint; @@ -299,6 +300,11 @@ public String agentPoolResourceGroup() { return innerModel().nodeResourceGroup(); } + @Override + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + @Override public void start() { this.startAsync().block(); @@ -705,6 +711,18 @@ public KubernetesClusterImpl withAgentPoolResourceGroup(String resourceGroupName return this; } + @Override + public KubernetesClusterImpl enablePublicNetworkAccess() { + this.innerModel().withPublicNetworkAccess(PublicNetworkAccess.ENABLED); + return this; + } + + @Override + public KubernetesClusterImpl disablePublicNetworkAccess() { + this.innerModel().withPublicNetworkAccess(PublicNetworkAccess.DISABLED); + return this; + } + private static final class PrivateLinkResourceImpl implements PrivateLinkResource { private final PrivateLinkResourceInner innerModel; diff --git a/sdk/resourcemanager/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubernetesCluster.java b/sdk/resourcemanager/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubernetesCluster.java index 0349723e74795..8e8c57e893c4f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubernetesCluster.java +++ b/sdk/resourcemanager/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/models/KubernetesCluster.java @@ -124,6 +124,13 @@ public interface KubernetesCluster */ String agentPoolResourceGroup(); + /** + * Whether the kubernetes cluster can be accessed from public network. + * + * @return whether the kubernetes cluster can be accessed from public network. + */ + PublicNetworkAccess publicNetworkAccess(); + // Actions /** @@ -175,6 +182,7 @@ interface Definition DefinitionStages.WithNetworkProfile, DefinitionStages.WithAddOnProfiles, DefinitionStages.WithManagedClusterSku, + DefinitionStages.WithPublicNetworkAccess, KubernetesCluster.DefinitionStages.WithCreate { } @@ -596,6 +604,16 @@ interface WithAgentPoolResourceGroup { WithCreate withAgentPoolResourceGroup(String resourceGroupName); } + /** The stage of Kubernetes cluster definition allowing to configure network access settings. */ + interface WithPublicNetworkAccess { + /** + * Disables public network access for the kubernetes cluster. + * + * @return the next stage of the definition + */ + WithCreate disablePublicNetworkAccess(); + } + /** * 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. @@ -615,6 +633,7 @@ interface WithCreate WithDiskEncryption, WithAgentPoolResourceGroup, WithManagedClusterSku, + WithPublicNetworkAccess, Resource.DefinitionWithTags { } } @@ -630,6 +649,7 @@ interface Update UpdateStages.WithLocalAccounts, UpdateStages.WithVersion, UpdateStages.WithManagedClusterSku, + UpdateStages.WithPublicNetworkAccess, Resource.UpdateWithTags, Appliable { } @@ -807,5 +827,22 @@ interface WithVersion { */ Update withVersion(String kubernetesVersion); } + + + /** The stage of kubernetes cluster update allowing to configure network access settings. */ + interface WithPublicNetworkAccess { + /** + * Enables public network access for the kubernetes cluster. + * + * @return the next stage of the update + */ + Update enablePublicNetworkAccess(); + /** + * Disables public network access for the kubernetes cluster. + * + * @return the next stage of the update + */ + Update disablePublicNetworkAccess(); + } } } diff --git a/sdk/resourcemanager/azure-resourcemanager-containerservice/src/test/java/com/azure/resourcemanager/containerservice/KubernetesClustersTests.java b/sdk/resourcemanager/azure-resourcemanager-containerservice/src/test/java/com/azure/resourcemanager/containerservice/KubernetesClustersTests.java index 550d4a67daf82..3f07b45e56734 100644 --- a/sdk/resourcemanager/azure-resourcemanager-containerservice/src/test/java/com/azure/resourcemanager/containerservice/KubernetesClustersTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-containerservice/src/test/java/com/azure/resourcemanager/containerservice/KubernetesClustersTests.java @@ -25,6 +25,7 @@ import com.azure.resourcemanager.containerservice.models.ManagedClusterSkuTier; import com.azure.resourcemanager.containerservice.models.OSDiskType; import com.azure.resourcemanager.containerservice.models.OrchestratorVersionProfile; +import com.azure.resourcemanager.containerservice.models.PublicNetworkAccess; import com.azure.resourcemanager.containerservice.models.ScaleSetEvictionPolicy; import com.azure.resourcemanager.containerservice.models.ScaleSetPriority; import com.azure.resourcemanager.resources.fluentcore.model.Accepted; @@ -626,4 +627,63 @@ public void testUpdateManagedClusterSkuAndKubernetesSupportPlan() { Assertions.assertEquals(ManagedClusterSkuTier.FREE, kubernetesCluster.sku().tier()); Assertions.assertEquals(KubernetesSupportPlan.KUBERNETES_OFFICIAL, kubernetesCluster.innerModel().supportPlan()); } + + @Test + public void canCreateKubernetesClusterWithDisablePublicNetworkAccess() { + String aksName = generateRandomResourceName("aks", 15); + String dnsPrefix = generateRandomResourceName("dns", 10); + String agentPoolName = generateRandomResourceName("ap0", 10); + + // create + KubernetesCluster kubernetesCluster = + containerServiceManager.kubernetesClusters().define(aksName) + .withRegion(Region.US_SOUTH_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() + .withDnsPrefix("mp1" + dnsPrefix) + .disablePublicNetworkAccess() + .create(); + + Assertions.assertEquals(PublicNetworkAccess.DISABLED, kubernetesCluster.publicNetworkAccess()); + } + + @Test + public void canUpdatePublicNetworkAccess() { + String aksName = generateRandomResourceName("aks", 15); + String dnsPrefix = generateRandomResourceName("dns", 10); + String agentPoolName = generateRandomResourceName("ap0", 10); + + // create + KubernetesCluster kubernetesCluster = + containerServiceManager.kubernetesClusters().define(aksName) + .withRegion(Region.US_SOUTH_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() + .withDnsPrefix("mp1" + dnsPrefix) + .create(); + + kubernetesCluster.update().disablePublicNetworkAccess().apply(); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, kubernetesCluster.publicNetworkAccess()); + + kubernetesCluster.update().enablePublicNetworkAccess().apply(); + Assertions.assertEquals(PublicNetworkAccess.ENABLED, kubernetesCluster.publicNetworkAccess()); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-cosmos/CHANGELOG.md b/sdk/resourcemanager/azure-resourcemanager-cosmos/CHANGELOG.md index 753325b59de28..9ab3766de616e 100644 --- a/sdk/resourcemanager/azure-resourcemanager-cosmos/CHANGELOG.md +++ b/sdk/resourcemanager/azure-resourcemanager-cosmos/CHANGELOG.md @@ -4,6 +4,8 @@ ### Features Added +- Supported disabling public network access in `CosmosDBAccount` via `disablePublicNetworkAccess()`, for private link feature. + ### Breaking Changes ### Bugs Fixed diff --git a/sdk/resourcemanager/azure-resourcemanager-cosmos/assets.json b/sdk/resourcemanager/azure-resourcemanager-cosmos/assets.json index 032ea75f28bc7..8537a56123aee 100644 --- a/sdk/resourcemanager/azure-resourcemanager-cosmos/assets.json +++ b/sdk/resourcemanager/azure-resourcemanager-cosmos/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/resourcemanager/azure-resourcemanager-cosmos", - "Tag": "java/resourcemanager/azure-resourcemanager-cosmos_166faee5e1" + "Tag": "java/resourcemanager/azure-resourcemanager-cosmos_dbcf178bc8" } diff --git a/sdk/resourcemanager/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBAccountImpl.java b/sdk/resourcemanager/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBAccountImpl.java index 3cbaeaade5a86..e27c33399d000 100644 --- a/sdk/resourcemanager/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBAccountImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBAccountImpl.java @@ -24,6 +24,7 @@ import com.azure.resourcemanager.cosmos.models.IpAddressOrRange; import com.azure.resourcemanager.cosmos.models.KeyKind; import com.azure.resourcemanager.cosmos.models.Location; +import com.azure.resourcemanager.cosmos.models.PublicNetworkAccess; import com.azure.resourcemanager.cosmos.models.PrivateEndpointConnection; import com.azure.resourcemanager.cosmos.models.PrivateLinkResource; import com.azure.resourcemanager.cosmos.models.PrivateLinkServiceConnectionStateProperty; @@ -80,6 +81,11 @@ public DatabaseAccountOfferType databaseAccountOfferType() { return this.innerModel().databaseAccountOfferType(); } + @Override + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + @Override public String ipRangeFilter() { if (CoreUtils.isNullOrEmpty(ipRules())) { @@ -507,6 +513,8 @@ private DatabaseAccountCreateUpdateParameters createUpdateParametersInner(Databa .withVirtualNetworkRules(new ArrayList(this.virtualNetworkRulesMap.values())); this.virtualNetworkRulesMap = null; } + createUpdateParametersInner.withPublicNetworkAccess(inner.publicNetworkAccess()); + return createUpdateParametersInner; } @@ -529,6 +537,7 @@ private DatabaseAccountUpdateParameters updateParametersInner(DatabaseAccountGet virtualNetworkRulesMap = null; } this.addLocationsForParameters(new UpdateLocationParameters(updateParameters), this.failoverPolicies); + updateParameters.withPublicNetworkAccess(inner.publicNetworkAccess()); return updateParameters; } @@ -787,6 +796,18 @@ public Mono rejectPrivateEndpointConnectionAsync(String privateEndpointCon .then(); } + @Override + public CosmosDBAccountImpl enablePublicNetworkAccess() { + this.innerModel().withPublicNetworkAccess(PublicNetworkAccess.ENABLED); + return this; + } + + @Override + public CosmosDBAccountImpl disablePublicNetworkAccess() { + this.innerModel().withPublicNetworkAccess(PublicNetworkAccess.DISABLED); + return this; + } + interface HasLocations { String location(); diff --git a/sdk/resourcemanager/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBAccount.java b/sdk/resourcemanager/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBAccount.java index dd04ab0a08741..5687d1343d923 100644 --- a/sdk/resourcemanager/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBAccount.java +++ b/sdk/resourcemanager/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBAccount.java @@ -36,6 +36,13 @@ public interface CosmosDBAccount /** @return the offer type for the CosmosDB database account */ DatabaseAccountOfferType databaseAccountOfferType(); + /** + * Whether the CosmosDB account can be accessed from public network. + * + * @return whether the CosmosDB account can be accessed from public network. + */ + PublicNetworkAccess publicNetworkAccess(); + /** * @return specifies the set of IP addresses or IP address ranges in CIDR form. * @deprecated use {@link #ipRules()} @@ -397,6 +404,16 @@ interface WithPrivateEndpointConnection { PrivateEndpointConnection.DefinitionStages.Blank defineNewPrivateEndpointConnection( String name); } + + /** The stage of CosmosDB account definition allowing to configure network access settings. */ + interface WithPublicNetworkAccess { + /** + * Disables public network access for the CosmosDB account. + * + * @return the next stage of the definition + */ + WithCreate disablePublicNetworkAccess(); + } /** * 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. @@ -411,7 +428,8 @@ interface WithCreate WithConnector, WithKeyBasedMetadataWriteAccess, WithPrivateEndpointConnection, - DefinitionWithTags { + DefinitionWithTags, + WithPublicNetworkAccess { } } @@ -431,7 +449,8 @@ interface WithOptionals UpdateStages.WithConnector, UpdateStages.WithKeyBasedMetadataWriteAccess, UpdateStages.WithPrivateEndpointConnection, - UpdateStages.WithIpRules { + UpdateStages.WithIpRules, + UpdateStages.WithPublicNetworkAccess { } /** The stage of the cosmos db definition allowing the definition of a write location. */ @@ -613,5 +632,21 @@ PrivateEndpointConnection.UpdateDefinitionStages.Blank defineNewP */ WithOptionals withoutPrivateEndpointConnection(String name); } + + /** The stage of CosmosDB account update allowing to configure network access settings. */ + interface WithPublicNetworkAccess { + /** + * Enables public network access for the CosmosDB account. + * + * @return the next stage of the update + */ + Update enablePublicNetworkAccess(); + /** + * Disables public network access for the CosmosDB account. + * + * @return the next stage of the update + */ + Update disablePublicNetworkAccess(); + } } } diff --git a/sdk/resourcemanager/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/CosmosDBTests.java b/sdk/resourcemanager/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/CosmosDBTests.java index 8507bb15299a2..4de8ca0eac4d6 100644 --- a/sdk/resourcemanager/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/CosmosDBTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-cosmos/src/test/java/com/azure/resourcemanager/cosmos/CosmosDBTests.java @@ -13,6 +13,7 @@ import com.azure.resourcemanager.cosmos.models.CosmosDBAccount; import com.azure.resourcemanager.cosmos.models.DatabaseAccountKind; import com.azure.resourcemanager.cosmos.models.DefaultConsistencyLevel; +import com.azure.resourcemanager.cosmos.models.PublicNetworkAccess; import com.azure.resourcemanager.cosmos.models.PrivateEndpointConnection; import com.azure.resourcemanager.network.models.Network; import com.azure.resourcemanager.network.models.PrivateEndpoint; @@ -279,4 +280,49 @@ public void canCreateCosmosDbAzureTableAccount() { Assertions.assertEquals(cosmosDBAccount.readableReplications().size(), 2); Assertions.assertEquals(cosmosDBAccount.defaultConsistencyLevel(), DefaultConsistencyLevel.EVENTUAL); } + + @Test + public void canCreateCosmosDBAccountWithDisablePublicNetworkAccess() { + final String cosmosDbAccountName = generateRandomResourceName("cosmosdb", 22); + + CosmosDBAccount cosmosDBAccount = + cosmosManager + .databaseAccounts() + .define(cosmosDbAccountName) + .withRegion(Region.US_WEST_CENTRAL) + .withNewResourceGroup(rgName) + .withDataModelAzureTable() + .withEventualConsistency() + .withWriteReplication(Region.US_EAST) + .withReadReplication(Region.US_WEST) + .withTag("tag1", "value1") + .disablePublicNetworkAccess() + .create(); + + Assertions.assertEquals(PublicNetworkAccess.DISABLED, cosmosDBAccount.publicNetworkAccess()); + } + + @Test + public void canUpdatePublicNetworkAccess() { + final String cosmosDbAccountName = generateRandomResourceName("cosmosdb", 22); + + CosmosDBAccount cosmosDBAccount = + cosmosManager + .databaseAccounts() + .define(cosmosDbAccountName) + .withRegion(Region.US_WEST_CENTRAL) + .withNewResourceGroup(rgName) + .withDataModelAzureTable() + .withEventualConsistency() + .withWriteReplication(Region.US_EAST) + .withReadReplication(Region.US_WEST) + .withTag("tag1", "value1") + .create(); + + cosmosDBAccount.update().disablePublicNetworkAccess().apply(); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, cosmosDBAccount.publicNetworkAccess()); + + cosmosDBAccount.update().enablePublicNetworkAccess().apply(); + Assertions.assertEquals(PublicNetworkAccess.ENABLED, cosmosDBAccount.publicNetworkAccess()); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-network/CHANGELOG.md b/sdk/resourcemanager/azure-resourcemanager-network/CHANGELOG.md index 350f7c5721d1e..519b878fdc796 100644 --- a/sdk/resourcemanager/azure-resourcemanager-network/CHANGELOG.md +++ b/sdk/resourcemanager/azure-resourcemanager-network/CHANGELOG.md @@ -4,6 +4,8 @@ ### Features Added +- Supported setting `DeleteOptions` for public IP addresses associated with `NetworkInterface`. + ### Breaking Changes ### Bugs Fixed diff --git a/sdk/resourcemanager/azure-resourcemanager-network/assets.json b/sdk/resourcemanager/azure-resourcemanager-network/assets.json index ccfb7e0098d77..daf9a4133b214 100644 --- a/sdk/resourcemanager/azure-resourcemanager-network/assets.json +++ b/sdk/resourcemanager/azure-resourcemanager-network/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/resourcemanager/azure-resourcemanager-network", - "Tag": "java/resourcemanager/azure-resourcemanager-network_271269e41a" + "Tag": "java/resourcemanager/azure-resourcemanager-network_03b4909e5e" } diff --git a/sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfaceImpl.java b/sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfaceImpl.java index 3b2d2c6e2f5ea..1a8793482863c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfaceImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NetworkInterfaceImpl.java @@ -9,6 +9,7 @@ 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.DeleteOptions; import com.azure.resourcemanager.network.models.IpAllocationMethod; import com.azure.resourcemanager.network.models.LoadBalancer; import com.azure.resourcemanager.network.models.Network; @@ -32,6 +33,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; +import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; @@ -60,11 +62,14 @@ class NetworkInterfaceImpl private NetworkSecurityGroup existingNetworkSecurityGroupToAssociate; /** cached related resources. */ private NetworkSecurityGroup networkSecurityGroup; + /** the name of specified ip config name */ + private Map specifiedIpConfigNames; NetworkInterfaceImpl(String name, NetworkInterfaceInner innerModel, final NetworkManager networkManager) { super(name, innerModel, networkManager); this.nicName = name; this.namer = this.manager().resourceManager().internalContext().createIdentifierProvider(this.nicName); + this.specifiedIpConfigNames = new HashMap(); initializeChildrenFromInner(); } @@ -563,9 +568,25 @@ protected void beforeCreating() { .withNetworkSecurityGroup(new NetworkSecurityGroupInner().withId(networkSecurityGroup.id())); } - NicIpConfigurationImpl.ensureConfigurations(this.nicIPConfigurations.values()); + NicIpConfigurationImpl.ensureConfigurations(this.nicIPConfigurations.values(), this.specifiedIpConfigNames); // Reset and update IP configs this.innerModel().withIpConfigurations(innersFromWrappers(this.nicIPConfigurations.values())); } + + @Override + public NetworkInterfaceImpl withPrimaryPublicIPAddressDeleteOptions(DeleteOptions deleteOptions) { + this.ensureDeleteOptions(deleteOptions, "primary"); + return this; + } + + @Override + public NetworkInterfaceImpl update() { + this.specifiedIpConfigNames = new HashMap(); + return super.update(); + } + + public void ensureDeleteOptions(DeleteOptions deleteOptions, String ipConfigName) { + this.specifiedIpConfigNames.put(ipConfigName, deleteOptions); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NicIpConfigurationImpl.java b/sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NicIpConfigurationImpl.java index aa05e3df0d123..ecca0e730cf00 100644 --- a/sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NicIpConfigurationImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/NicIpConfigurationImpl.java @@ -9,6 +9,7 @@ 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.DeleteOptions; import com.azure.resourcemanager.network.models.IpAllocationMethod; import com.azure.resourcemanager.network.models.IpVersion; import com.azure.resourcemanager.network.models.LoadBalancer; @@ -28,6 +29,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.Map; import java.util.Objects; /** Implementation for NicIPConfiguration and its create and update interfaces. */ @@ -257,11 +259,11 @@ private List ensureInboundNatRules() { return natRefs; } - protected static void ensureConfigurations(Collection nicIPConfigurations) { + protected static void ensureConfigurations(Collection nicIPConfigurations, Map specifiedIpConfigNames) { for (NicIpConfiguration nicIPConfiguration : nicIPConfigurations) { NicIpConfigurationImpl config = (NicIpConfigurationImpl) nicIPConfiguration; config.innerModel().withSubnet(config.subnetToAssociate()); - config.innerModel().withPublicIpAddress(config.publicIPToAssociate()); + config.innerModel().withPublicIpAddress(config.publicIPToAssociate(specifiedIpConfigNames.getOrDefault(config.name(), null))); } } @@ -331,9 +333,10 @@ private SubnetInner subnetToAssociate() { * 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. * + * @param deleteOptions what happens to the public IP address when the VM using it is deleted * @return public IP SubResource */ - private PublicIpAddressInner publicIPToAssociate() { + private PublicIpAddressInner publicIPToAssociate(DeleteOptions deleteOptions) { String pipId = null; if (this.removePrimaryPublicIPAssociation) { return null; @@ -344,8 +347,14 @@ private PublicIpAddressInner publicIPToAssociate() { } if (pipId != null) { + if (Objects.nonNull(deleteOptions)) { + return new PublicIpAddressInner().withId(pipId).withDeleteOption(deleteOptions); + } return new PublicIpAddressInner().withId(pipId); } else if (!this.isInCreateMode) { + if (Objects.nonNull(this.innerModel().publicIpAddress()) && Objects.nonNull(deleteOptions)) { + return this.innerModel().publicIpAddress().withDeleteOption(deleteOptions); + } return this.innerModel().publicIpAddress(); } else { return null; @@ -400,4 +409,10 @@ NicIpConfigurationImpl withoutApplicationSecurityGroup(String name) { } return this; } + + @Override + public NicIpConfigurationImpl withPublicIPAddressDeleteOptions(DeleteOptions deleteOptions) { + this.parent().ensureDeleteOptions(deleteOptions, this.innerModel().name()); + return this; + } } diff --git a/sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterface.java b/sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterface.java index 84f1a5cb888d8..e080c4b56b1b7 100644 --- a/sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterface.java +++ b/sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NetworkInterface.java @@ -256,6 +256,17 @@ interface WithAcceleratedNetworking { WithCreate withAcceleratedNetworking(); } + /** The stage of the definition allowing to specify delete options for the public ip address. */ + interface WithPublicIPAddressDeleteOptions { + /** + * Sets delete options for public ip address. + * + * @param deleteOptions the delete options for primary network interfaces + * @return the next stage of the update + */ + WithCreate withPrimaryPublicIPAddressDeleteOptions(DeleteOptions deleteOptions); + } + /** * 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. @@ -268,7 +279,8 @@ interface WithCreate WithSecondaryIPConfiguration, WithAcceleratedNetworking, WithLoadBalancer, - WithApplicationSecurityGroup { + WithApplicationSecurityGroup, + WithPublicIPAddressDeleteOptions { /** * Enables IP forwarding in the network interface. * @@ -576,6 +588,18 @@ interface WithLoadBalancer { */ Update withoutLoadBalancerInboundNatRules(); } + + /** The stage of the network interface update allowing to specify delete options for the public ip address. */ + interface WithPublicIPAddressDeleteOptions { + + /** + * Sets delete options for public ip address. + * + * @param deleteOptions the delete options for primary network interfaces + * @return the next stage of the update + */ + Update withPrimaryPublicIPAddressDeleteOptions(DeleteOptions deleteOptions); + } } /** The template for an update operation, containing all the settings that can be modified. */ @@ -591,6 +615,7 @@ interface Update UpdateStages.WithIPConfiguration, UpdateStages.WithLoadBalancer, UpdateStages.WithAcceleratedNetworking, - UpdateStages.WithApplicationSecurityGroup { + UpdateStages.WithApplicationSecurityGroup, + UpdateStages.WithPublicIPAddressDeleteOptions { } } diff --git a/sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NicIpConfiguration.java b/sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NicIpConfiguration.java index 2441c4d31d57d..fb6dcb288b463 100644 --- a/sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NicIpConfiguration.java +++ b/sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/models/NicIpConfiguration.java @@ -188,6 +188,22 @@ WithAttach withExistingApplicationGatewayBackend( ApplicationGateway appGateway, String backendName); } + + /** The stage of the definition allowing to specify delete options for the public ip address. + * + * @param the stage of the parent network interface definition to return to after attaching this + * definition + * */ + interface WithPublicIPAddressDeleteOptions { + /** + * Sets delete options for public ip address. + * + * @param deleteOptions the delete options for primary network interfaces + * @return the next stage of the definition + */ + WithAttach withPublicIPAddressDeleteOptions(DeleteOptions deleteOptions); + } + /** * The final stage of network interface IP configuration. * @@ -201,7 +217,8 @@ interface WithAttach extends Attachable.InDefinition, WithPublicIPAddress, WithLoadBalancer, - WithApplicationGateway { + WithApplicationGateway, + WithPublicIPAddressDeleteOptions { } } @@ -372,6 +389,22 @@ WithAttach withExistingApplicationGatewayBackend( ApplicationGateway appGateway, String backendName); } + /** + * The stage of the definition allowing to specify delete options for the public ip address. + * + * @param the stage of the parent network interface update to return to after attaching this + * definition + * */ + interface WithPublicIPAddressDeleteOptions { + /** + * Sets delete options for public ip address. + * + * @param deleteOptions the delete options for primary network interfaces + * @return the next stage of the update + */ + WithAttach withPublicIPAddressDeleteOptions(DeleteOptions deleteOptions); + } + /** * The final stage of network interface IP configuration. * @@ -385,7 +418,8 @@ interface WithAttach extends Attachable.InUpdate, WithPublicIPAddress, WithLoadBalancer, - WithApplicationGateway { + WithApplicationGateway, + WithPublicIPAddressDeleteOptions { } } @@ -396,7 +430,8 @@ interface Update UpdateStages.WithPrivateIP, UpdateStages.WithPublicIPAddress, UpdateStages.WithLoadBalancer, - UpdateStages.WithApplicationGateway { + UpdateStages.WithApplicationGateway, + UpdateStages.WithPublicIPAddressDeleteOptions { } /** Grouping of network interface IP configuration update stages. */ @@ -486,5 +521,16 @@ interface WithApplicationGateway { */ Update withoutApplicationGatewayBackends(); } + + /** The stage of the network interface update allowing to specify delete options for the public ip address. */ + interface WithPublicIPAddressDeleteOptions { + /** + * Sets delete options for public ip address. + * + * @param deleteOptions the delete options for primary network interfaces + * @return the next stage of the update + */ + Update withPublicIPAddressDeleteOptions(DeleteOptions deleteOptions); + } } } diff --git a/sdk/resourcemanager/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkInterfaceOperationsTests.java b/sdk/resourcemanager/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkInterfaceOperationsTests.java index 4f74986fe237c..41523fe1a7d4d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkInterfaceOperationsTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-network/src/test/java/com/azure/resourcemanager/network/NetworkInterfaceOperationsTests.java @@ -6,6 +6,7 @@ import com.azure.core.management.Region; import com.azure.resourcemanager.network.fluent.models.NatGatewayInner; import com.azure.resourcemanager.network.models.ApplicationSecurityGroup; +import com.azure.resourcemanager.network.models.DeleteOptions; import com.azure.resourcemanager.network.models.NatGatewaySku; import com.azure.resourcemanager.network.models.NatGatewaySkuName; import com.azure.resourcemanager.network.models.Network; @@ -509,6 +510,80 @@ public void canAssociateNatGateway() { Assertions.assertEquals(gateway2.id(), subnet2.natGatewayId()); } + @Test + public void canCreateAndUpdateNicWithMultipleDeleteOptions() { + String subnetName = generateRandomResourceName("subnet-", 15); + resourceManager.resourceGroups().define(rgName).withRegion(Region.US_EAST).create(); + Network vnet = networkManager.networks() + .define(generateRandomResourceName("vnet-", 15)) + .withRegion(Region.US_EAST) + .withExistingResourceGroup(rgName) + .withAddressSpace("10.0.0.0/28") + .withSubnet(subnetName, "10.0.0.0/28") + .create(); + + NetworkInterface nic = networkManager.networkInterfaces() + .define(generateRandomResourceName("nic-", 15)) + .withRegion(Region.US_EAST) + .withExistingResourceGroup(rgName) + .withExistingPrimaryNetwork(vnet) + .withSubnet(subnetName) + .withPrimaryPrivateIPAddressDynamic() + .withNewPrimaryPublicIPAddress() + .withPrimaryPublicIPAddressDeleteOptions(DeleteOptions.DELETE) + .defineSecondaryIPConfiguration("secondary1") + .withExistingNetwork(vnet) + .withSubnet(subnetName) + .withPrivateIpAddressDynamic() + .withNewPublicIpAddress() + .withPublicIPAddressDeleteOptions(DeleteOptions.DETACH) + .attach() + .defineSecondaryIPConfiguration("secondary2") + .withExistingNetwork(vnet) + .withSubnet(subnetName) + .withPrivateIpAddressDynamic() + .withNewPublicIpAddress() + .withPublicIPAddressDeleteOptions(DeleteOptions.DETACH) + .attach() + .create(); + + nic.refresh(); + Assertions.assertEquals(DeleteOptions.DELETE, nic.primaryIPConfiguration().innerModel().publicIpAddress().deleteOption()); + Assertions.assertEquals(DeleteOptions.DETACH, nic.ipConfigurations().get("secondary1").innerModel().publicIpAddress().deleteOption()); + Assertions.assertEquals(DeleteOptions.DETACH, nic.ipConfigurations().get("secondary2").innerModel().publicIpAddress().deleteOption()); + + String existingPrimaryIpAddressId = nic.primaryIPConfiguration().publicIpAddressId(); + nic.update().withNewPrimaryPublicIPAddress().withPrimaryPublicIPAddressDeleteOptions(DeleteOptions.DETACH).apply(); + nic.refresh(); + Assertions.assertFalse(existingPrimaryIpAddressId.equalsIgnoreCase(nic.primaryIPConfiguration().publicIpAddressId())); + Assertions.assertEquals(DeleteOptions.DETACH, nic.primaryIPConfiguration().innerModel().publicIpAddress().deleteOption()); + + String existingSecondary1IpAddressId = nic.ipConfigurations().get("secondary1").publicIpAddressId(); + nic.update() + .withPrimaryPublicIPAddressDeleteOptions(DeleteOptions.DELETE) + .updateIPConfiguration("secondary1") + .withNewPublicIpAddress() + .withPublicIPAddressDeleteOptions(DeleteOptions.DELETE) + .parent() + .updateIPConfiguration("secondary2") + .withPublicIPAddressDeleteOptions(DeleteOptions.DELETE) + .parent() + .defineSecondaryIPConfiguration("secondary3") + .withExistingNetwork(vnet) + .withSubnet(subnetName) + .withPrivateIpAddressDynamic() + .withNewPublicIpAddress() + .withPublicIPAddressDeleteOptions(DeleteOptions.DELETE) + .attach() + .apply(); + nic.refresh(); + Assertions.assertFalse(existingSecondary1IpAddressId.equalsIgnoreCase(nic.ipConfigurations().get("secondary1").publicIpAddressId())); + Assertions.assertEquals(DeleteOptions.DELETE, nic.primaryIPConfiguration().innerModel().publicIpAddress().deleteOption()); + Assertions.assertEquals(DeleteOptions.DELETE, nic.ipConfigurations().get("secondary1").innerModel().publicIpAddress().deleteOption()); + Assertions.assertEquals(DeleteOptions.DELETE, nic.ipConfigurations().get("secondary2").innerModel().publicIpAddress().deleteOption()); + Assertions.assertEquals(DeleteOptions.DELETE, nic.ipConfigurations().get("secondary3").innerModel().publicIpAddress().deleteOption()); + } + private NatGatewayInner createNatGateway() { String natGatewayName = generateRandomResourceName("natgw", 10); return networkManager.serviceClient() diff --git a/sdk/resourcemanager/azure-resourcemanager-redis/CHANGELOG.md b/sdk/resourcemanager/azure-resourcemanager-redis/CHANGELOG.md index 095cc473a508f..a62219792f44f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-redis/CHANGELOG.md +++ b/sdk/resourcemanager/azure-resourcemanager-redis/CHANGELOG.md @@ -4,6 +4,8 @@ ### Features Added +- Supported disabling public network access in `RedisCache` via `disablePublicNetworkAccess()`, for private link feature. + ### Breaking Changes ### Bugs Fixed diff --git a/sdk/resourcemanager/azure-resourcemanager-redis/assets.json b/sdk/resourcemanager/azure-resourcemanager-redis/assets.json index 916cca521e226..fb78b8e4a21aa 100644 --- a/sdk/resourcemanager/azure-resourcemanager-redis/assets.json +++ b/sdk/resourcemanager/azure-resourcemanager-redis/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/resourcemanager/azure-resourcemanager-redis", - "Tag": "java/resourcemanager/azure-resourcemanager-redis_df48c9d2b2" + "Tag": "java/resourcemanager/azure-resourcemanager-redis_50169e9af1" } diff --git a/sdk/resourcemanager/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisCacheImpl.java b/sdk/resourcemanager/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisCacheImpl.java index bb5e24a0352a3..ef77728d300a0 100644 --- a/sdk/resourcemanager/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisCacheImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisCacheImpl.java @@ -17,6 +17,7 @@ import com.azure.resourcemanager.redis.models.ExportRdbParameters; import com.azure.resourcemanager.redis.models.ImportRdbParameters; import com.azure.resourcemanager.redis.models.ProvisioningState; +import com.azure.resourcemanager.redis.models.PublicNetworkAccess; import com.azure.resourcemanager.redis.models.RebootType; import com.azure.resourcemanager.redis.models.RedisAccessKeys; import com.azure.resourcemanager.redis.models.RedisCache; @@ -196,6 +197,11 @@ public RedisAccessKeys regenerateKey(RedisKeyType keyType) { return cachedAccessKeys; } + @Override + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + @Override public void forceReboot(RebootType rebootType) { RedisRebootParameters parameters = new RedisRebootParameters().withRebootType(rebootType); @@ -730,6 +736,26 @@ public Mono rejectPrivateEndpointConnectionAsync(String privateEndpointCon .then(); } + @Override + public RedisCacheImpl enablePublicNetworkAccess() { + if (isInCreateMode()) { + createParameters.withPublicNetworkAccess(PublicNetworkAccess.ENABLED); + } else { + updateParameters.withPublicNetworkAccess(PublicNetworkAccess.ENABLED); + } + return this; + } + + @Override + public RedisCacheImpl disablePublicNetworkAccess() { + if (isInCreateMode()) { + createParameters.withPublicNetworkAccess(PublicNetworkAccess.DISABLED); + } else { + updateParameters.withPublicNetworkAccess(PublicNetworkAccess.DISABLED); + } + return this; + } + private static final class PrivateLinkResourceImpl implements PrivateLinkResource { private final PrivateLinkResourceInner innerModel; diff --git a/sdk/resourcemanager/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCache.java b/sdk/resourcemanager/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCache.java index d90d3224632ef..fa34488de218a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCache.java +++ b/sdk/resourcemanager/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCache.java @@ -104,6 +104,13 @@ public interface RedisCache */ RedisAccessKeys regenerateKey(RedisKeyType keyType); + /** + * Whether the redis cache can be accessed from public network. + * + * @return whether the redis cache can be accessed from public network. + */ + PublicNetworkAccess publicNetworkAccess(); + /************************************************************** * Fluent interfaces to provision a RedisCache **************************************************************/ @@ -289,6 +296,13 @@ interface WithCreate extends Creatable, DefinitionWithTags, UpdateStages.WithSku, UpdateStages.WithNonSslPort, - UpdateStages.WithRedisConfiguration { + UpdateStages.WithRedisConfiguration, + UpdateStages.WithPublicNetworkAccess { /** * The number of shards to be created on a Premium Cluster Cache. * diff --git a/sdk/resourcemanager/azure-resourcemanager-redis/src/test/java/com/azure/resourcemanager/redis/RedisCacheOperationsTests.java b/sdk/resourcemanager/azure-resourcemanager-redis/src/test/java/com/azure/resourcemanager/redis/RedisCacheOperationsTests.java index a782314764166..2d30aff4a33c9 100644 --- a/sdk/resourcemanager/azure-resourcemanager-redis/src/test/java/com/azure/resourcemanager/redis/RedisCacheOperationsTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-redis/src/test/java/com/azure/resourcemanager/redis/RedisCacheOperationsTests.java @@ -7,6 +7,7 @@ import com.azure.core.management.Region; import com.azure.core.management.exception.ManagementException; import com.azure.resourcemanager.redis.models.DayOfWeek; +import com.azure.resourcemanager.redis.models.PublicNetworkAccess; import com.azure.resourcemanager.redis.models.RebootType; import com.azure.resourcemanager.redis.models.RedisAccessKeys; import com.azure.resourcemanager.redis.models.RedisCache; @@ -369,6 +370,42 @@ public void canCreateRedisWithRdbAof() { assertSameVersion(RedisCache.RedisVersion.V6, redisCache.redisVersion()); } + @Test + public void canCreateRedisCacheWithDisablePublicNetworkAccess() { + resourceManager.resourceGroups().define(rgNameSecond).withRegion(Region.US_CENTRAL); + + RedisCache redisCache = + redisManager + .redisCaches() + .define(rrName) + .withRegion(Region.ASIA_EAST) + .withNewResourceGroup(rgName) + .withBasicSku() + .disablePublicNetworkAccess() + .create(); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, redisCache.publicNetworkAccess()); + } + + @Test + public void canUpdatePublicNetworkAccess() { + resourceManager.resourceGroups().define(rgNameSecond).withRegion(Region.US_CENTRAL); + + RedisCache redisCache = + redisManager + .redisCaches() + .define(rrName) + .withRegion(Region.ASIA_EAST) + .withNewResourceGroup(rgName) + .withBasicSku() + .create(); + + redisCache.update().disablePublicNetworkAccess().apply(); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, redisCache.publicNetworkAccess()); + + redisCache.update().enablePublicNetworkAccess().apply(); + Assertions.assertEquals(PublicNetworkAccess.ENABLED, redisCache.publicNetworkAccess()); + } + // e.g 6.xxxx private static final Pattern MINOR_VERSION_REGEX = Pattern.compile("([1-9]+)\\..*"); diff --git a/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageFunctionAppLogs.java b/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageFunctionAppLogs.java index 5f3527fecc320..33fe365d46361 100644 --- a/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageFunctionAppLogs.java +++ b/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageFunctionAppLogs.java @@ -8,6 +8,8 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.resourcemanager.AzureResourceManager; +import com.azure.resourcemanager.appservice.fluent.models.CsmPublishingCredentialsPoliciesEntityProperties; +import com.azure.resourcemanager.appservice.models.FtpsState; import com.azure.resourcemanager.appservice.models.FunctionApp; import com.azure.resourcemanager.appservice.models.LogLevel; import com.azure.core.management.Region; @@ -61,11 +63,23 @@ public static boolean runSample(AzureResourceManager azureResourceManager) throw .withLogLevel(LogLevel.VERBOSE) .withApplicationLogsStoredOnFileSystem() .attach() + .withFtpsState(FtpsState.ALL_ALLOWED) .create(); System.out.println("Created function app " + app.name()); Utils.print(app); + app.manager().resourceManager().genericResources().define("ftp") + .withRegion(app.regionName()) + .withExistingResourceGroup(app.resourceGroupName()) + .withResourceType("basicPublishingCredentialsPolicies") + .withProviderNamespace("Microsoft.Web") + .withoutPlan() + .withParentResourcePath("sites/" + app.name()) + .withApiVersion("2023-01-01") + .withProperties(new CsmPublishingCredentialsPoliciesEntityProperties().withAllow(true)) + .create(); + //============================================================ // Deploy to app 1 through FTP diff --git a/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageLinuxWebAppStorageAccountConnection.java b/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageLinuxWebAppStorageAccountConnection.java index 8b34ccf121387..a78db8be5581c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageLinuxWebAppStorageAccountConnection.java +++ b/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageLinuxWebAppStorageAccountConnection.java @@ -8,7 +8,9 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.resourcemanager.AzureResourceManager; +import com.azure.resourcemanager.appservice.fluent.models.CsmPublishingCredentialsPoliciesEntityProperties; import com.azure.resourcemanager.appservice.models.ConnectionStringType; +import com.azure.resourcemanager.appservice.models.FtpsState; import com.azure.resourcemanager.appservice.models.PricingTier; import com.azure.resourcemanager.appservice.models.RuntimeStack; import com.azure.resourcemanager.appservice.models.WebApp; @@ -101,11 +103,23 @@ public static boolean runSample(AzureResourceManager azureResourceManager) { .withBuiltInImage(RuntimeStack.TOMCAT_8_5_JRE8) .withConnectionString("storage.connectionString", connectionString, ConnectionStringType.CUSTOM) .withAppSetting("storage.containerName", containerName) + .withFtpsState(FtpsState.ALL_ALLOWED) .create(); System.out.println("Created web app " + app1.name()); Utils.print(app1); + app1.manager().resourceManager().genericResources().define("ftp") + .withRegion(app1.regionName()) + .withExistingResourceGroup(app1.resourceGroupName()) + .withResourceType("basicPublishingCredentialsPolicies") + .withProviderNamespace("Microsoft.Web") + .withoutPlan() + .withParentResourcePath("sites/" + app1.name()) + .withApiVersion("2023-01-01") + .withProperties(new CsmPublishingCredentialsPoliciesEntityProperties().withAllow(true)) + .create(); + //============================================================ // Deploy a web app that connects to the storage account // Source code: https://github.com/jianghaolu/azure-samples-blob-explorer diff --git a/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppCosmosDbThroughKeyVault.java b/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppCosmosDbThroughKeyVault.java index c5522a09e7a20..20a4f2e38d7a4 100644 --- a/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppCosmosDbThroughKeyVault.java +++ b/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppCosmosDbThroughKeyVault.java @@ -8,6 +8,8 @@ import com.azure.core.util.Configuration; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.resourcemanager.AzureResourceManager; +import com.azure.resourcemanager.appservice.fluent.models.CsmPublishingCredentialsPoliciesEntityProperties; +import com.azure.resourcemanager.appservice.models.FtpsState; import com.azure.resourcemanager.appservice.models.JavaVersion; import com.azure.resourcemanager.appservice.models.PricingTier; import com.azure.resourcemanager.appservice.models.WebApp; @@ -111,11 +113,23 @@ public static boolean runSample(AzureResourceManager azureResourceManager, Strin .withWebContainer(WebContainer.TOMCAT_8_5_NEWEST) .withAppSetting("AZURE_KEYVAULT_URI", vault.vaultUri()) .withSystemAssignedManagedServiceIdentity() + .withFtpsState(FtpsState.ALL_ALLOWED) .create(); System.out.println("Created web app " + app.name()); Utils.print(app); + app.manager().resourceManager().genericResources().define("ftp") + .withRegion(app.regionName()) + .withExistingResourceGroup(app.resourceGroupName()) + .withResourceType("basicPublishingCredentialsPolicies") + .withProviderNamespace("Microsoft.Web") + .withoutPlan() + .withParentResourcePath("sites/" + app.name()) + .withApiVersion("2023-01-01") + .withProperties(new CsmPublishingCredentialsPoliciesEntityProperties().withAllow(true)) + .create(); + //============================================================ // Update vault to allow the web app to access diff --git a/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppStorageAccountConnection.java b/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppStorageAccountConnection.java index 48d562d80c09d..9647f8062963b 100644 --- a/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppStorageAccountConnection.java +++ b/sdk/resourcemanager/azure-resourcemanager-samples/src/main/java/com/azure/resourcemanager/appservice/samples/ManageWebAppStorageAccountConnection.java @@ -8,7 +8,9 @@ import com.azure.core.management.AzureEnvironment; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.resourcemanager.AzureResourceManager; +import com.azure.resourcemanager.appservice.fluent.models.CsmPublishingCredentialsPoliciesEntityProperties; 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.PricingTier; import com.azure.resourcemanager.appservice.models.WebApp; @@ -102,11 +104,23 @@ public static boolean runSample(AzureResourceManager azureResourceManager) { .withWebContainer(WebContainer.TOMCAT_8_0_NEWEST) .withConnectionString("storage.connectionString", connectionString, ConnectionStringType.CUSTOM) .withAppSetting("storage.containerName", containerName) + .withFtpsState(FtpsState.ALL_ALLOWED) .create(); System.out.println("Created web app " + app1.name()); Utils.print(app1); + app1.manager().resourceManager().genericResources().define("ftp") + .withRegion(app1.regionName()) + .withExistingResourceGroup(app1.resourceGroupName()) + .withResourceType("basicPublishingCredentialsPolicies") + .withProviderNamespace("Microsoft.Web") + .withoutPlan() + .withParentResourcePath("sites/" + app1.name()) + .withApiVersion("2023-01-01") + .withProperties(new CsmPublishingCredentialsPoliciesEntityProperties().withAllow(true)) + .create(); + //============================================================ // Deploy a web app that connects to the storage account // Source code: https://github.com/jianghaolu/azure-samples-blob-explorer diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/CHANGELOG.md b/sdk/resourcemanager/azure-resourcemanager-storage/CHANGELOG.md index 9fc9422edfca1..8984047527d6f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/CHANGELOG.md +++ b/sdk/resourcemanager/azure-resourcemanager-storage/CHANGELOG.md @@ -4,6 +4,8 @@ ### Features Added +- Supported disabling public network access in `StorageAccount` via `disablePublicNetworkAccess()`, for private link feature. + ### Breaking Changes ### Bugs Fixed diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/assets.json b/sdk/resourcemanager/azure-resourcemanager-storage/assets.json index 285b19032c728..f11fbbe8e8a3c 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/assets.json +++ b/sdk/resourcemanager/azure-resourcemanager-storage/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/resourcemanager/azure-resourcemanager-storage", - "Tag": "java/resourcemanager/azure-resourcemanager-storage_9e28ed11a8" + "Tag": "java/resourcemanager/azure-resourcemanager-storage_3aaa86972f" } diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountImpl.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountImpl.java index 5524285d8fc49..b0420002c3a1f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountImpl.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountImpl.java @@ -37,6 +37,7 @@ 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.PublicNetworkAccess; import com.azure.resourcemanager.storage.models.Sku; import com.azure.resourcemanager.storage.models.StorageAccount; import com.azure.resourcemanager.storage.models.StorageAccountCreateParameters; @@ -280,6 +281,11 @@ public String userAssignedIdentityIdForCustomerEncryptionKey() { return this.encryptionHelper.userAssignedIdentityIdForKeyVault(this.innerModel()); } + @Override + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); + } + @Override public List getKeys() { return this.getKeysAsync().block(); @@ -667,6 +673,26 @@ public StorageAccountImpl disableDefaultToOAuthAuthentication() { return this; } + @Override + public StorageAccountImpl enablePublicNetworkAccess() { + if (isInCreateMode()) { + createParameters.withPublicNetworkAccess(PublicNetworkAccess.ENABLED); + } else { + updateParameters.withPublicNetworkAccess(PublicNetworkAccess.ENABLED); + } + return this; + } + + @Override + public StorageAccountImpl disablePublicNetworkAccess() { + if (isInCreateMode()) { + createParameters.withPublicNetworkAccess(PublicNetworkAccess.DISABLED); + } else { + updateParameters.withPublicNetworkAccess(PublicNetworkAccess.DISABLED); + } + return this; + } + @Override public StorageAccountImpl withAccessFromAllNetworks() { this.networkRulesHelper.withAccessFromAllNetworks(); diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccount.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccount.java index 67b334aa5da02..ba729c4d2869a 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccount.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/models/StorageAccount.java @@ -252,6 +252,12 @@ public interface StorageAccount * {@link StorageAccount#identityTypeForCustomerEncryptionKey()} is not {@link IdentityType#USER_ASSIGNED} */ String userAssignedIdentityIdForCustomerEncryptionKey(); + /** + * Whether the storage account can be accessed from public network. + * + * @return whether the storage account can be accessed from public network. + */ + PublicNetworkAccess publicNetworkAccess(); /** Container interface for all the definitions that need to be implemented. */ interface Definition @@ -559,6 +565,12 @@ interface WithBlobAccess { /** The stage of storage account definition allowing to configure network access settings. */ interface WithNetworkAccess { + /** + * Disables public network access for the storage account. + * + * @return the next stage of the definition + */ + WithCreate disablePublicNetworkAccess(); /** * Specifies that by default access to storage account should be allowed from all networks. * @@ -989,6 +1001,20 @@ interface WithBlobAccess { /** The stage of storage account update allowing to configure network access. */ interface WithNetworkAccess { + /** + * Enables public network access for the storage account. + * + * @return the next stage of the update + */ + Update enablePublicNetworkAccess(); + + /** + * Disables public network access for the storage account. + * + * @return the next stage of the update + */ + Update disablePublicNetworkAccess(); + /** * Specifies that by default access to storage account should be allowed from all networks. * diff --git a/sdk/resourcemanager/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageAccountOperationsTests.java b/sdk/resourcemanager/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageAccountOperationsTests.java index 0131a6df615ff..beef09f1d178f 100644 --- a/sdk/resourcemanager/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageAccountOperationsTests.java +++ b/sdk/resourcemanager/azure-resourcemanager-storage/src/test/java/com/azure/resourcemanager/storage/StorageAccountOperationsTests.java @@ -11,6 +11,7 @@ import com.azure.resourcemanager.storage.models.IdentityType; import com.azure.resourcemanager.storage.models.Kind; import com.azure.resourcemanager.storage.models.MinimumTlsVersion; +import com.azure.resourcemanager.storage.models.PublicNetworkAccess; import com.azure.resourcemanager.storage.models.SkuName; import com.azure.resourcemanager.storage.models.StorageAccount; import com.azure.resourcemanager.storage.models.StorageAccountEncryptionStatus; @@ -714,4 +715,35 @@ public void updateIdentityFromNoneToSystemUserAssigned() { Assertions.assertNotNull(storageAccount.systemAssignedManagedServiceIdentityTenantId()); Assertions.assertFalse(storageAccount.userAssignedManagedServiceIdentityIds().isEmpty()); } + + @Test + public void canCreateStorageAccountWithDisabledPublicNetworkAccess() { + resourceManager.resourceGroups().define(rgName).withRegion(Region.US_EAST).create(); + StorageAccount storageAccount = storageManager + .storageAccounts() + .define(saName) + .withRegion(Region.US_EAST) + .withExistingResourceGroup(rgName) + .withSystemAssignedManagedServiceIdentity() + .disablePublicNetworkAccess() + .create(); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, storageAccount.publicNetworkAccess()); + } + + @Test + public void canUpdatePublicNetworkAccess() { + resourceManager.resourceGroups().define(rgName).withRegion(Region.US_EAST).create(); + StorageAccount storageAccount = storageManager + .storageAccounts() + .define(saName) + .withRegion(Region.US_EAST) + .withExistingResourceGroup(rgName) + .withSystemAssignedManagedServiceIdentity() + .create(); + storageAccount.update().disablePublicNetworkAccess().apply(); + Assertions.assertEquals(PublicNetworkAccess.DISABLED, storageAccount.publicNetworkAccess()); + + storageAccount.update().enablePublicNetworkAccess().apply(); + Assertions.assertEquals(PublicNetworkAccess.ENABLED, storageAccount.publicNetworkAccess()); + } } diff --git a/sdk/resourcemanager/azure-resourcemanager/pom.xml b/sdk/resourcemanager/azure-resourcemanager/pom.xml index 6d6a1824231f3..8d8151f3dc7b0 100644 --- a/sdk/resourcemanager/azure-resourcemanager/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager/pom.xml @@ -223,6 +223,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + org.mockito mockito-core @@ -267,6 +273,20 @@ + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + diff --git a/sdk/resourcemanagerhybrid/azure-resourcemanager/pom.xml b/sdk/resourcemanagerhybrid/azure-resourcemanager/pom.xml index a93804c9dfa55..5fb5642b2a6e3 100644 --- a/sdk/resourcemanagerhybrid/azure-resourcemanager/pom.xml +++ b/sdk/resourcemanagerhybrid/azure-resourcemanager/pom.xml @@ -156,6 +156,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.jcraft jsch @@ -180,6 +186,21 @@ + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + diff --git a/sdk/serialization/azure-xml/src/main/java/com/azure/xml/ReadValueCallback.java b/sdk/serialization/azure-xml/src/main/java/com/azure/xml/ReadValueCallback.java index e98bced897c3e..c761e8764a4c4 100644 --- a/sdk/serialization/azure-xml/src/main/java/com/azure/xml/ReadValueCallback.java +++ b/sdk/serialization/azure-xml/src/main/java/com/azure/xml/ReadValueCallback.java @@ -4,7 +4,6 @@ package com.azure.xml; import javax.xml.stream.XMLStreamException; -import java.io.IOException; /** * A callback used when reading an XML value, such as {@link XmlReader#getNullableElement(ReadValueCallback)}. @@ -20,9 +19,6 @@ public interface ReadValueCallback { * @param input Input to the callback. * @return The output of the callback. * @throws XMLStreamException If an XML stream error occurs during application of the callback. - * @throws IOException If an I/O error occurs during application of the callback, {@link XmlReader} and - * {@link XmlWriter} APIs will catch {@link IOException IOExceptions} and wrap them in an - * {@link XMLStreamException}. */ - R read(T input) throws XMLStreamException, IOException; + R read(T input) throws XMLStreamException; } diff --git a/sdk/serialization/azure-xml/src/main/java/com/azure/xml/XmlReader.java b/sdk/serialization/azure-xml/src/main/java/com/azure/xml/XmlReader.java index 247bd898577dd..e6dd7f9241673 100644 --- a/sdk/serialization/azure-xml/src/main/java/com/azure/xml/XmlReader.java +++ b/sdk/serialization/azure-xml/src/main/java/com/azure/xml/XmlReader.java @@ -9,7 +9,6 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import java.io.ByteArrayInputStream; -import java.io.IOException; import java.io.InputStream; import java.io.Reader; import java.io.StringReader; @@ -282,11 +281,7 @@ public T getNullableAttribute(String namespaceUri, String localName, ReadVal return null; } - try { - return converter.read(textValue); - } catch (IOException ex) { - throw new XMLStreamException(ex); - } + return converter.read(textValue); } /** @@ -441,11 +436,7 @@ public T getNullableElement(ReadValueCallback converter) throws X return null; } - try { - return converter.read(textValue); - } catch (IOException ex) { - throw new XMLStreamException(ex); - } + return converter.read(textValue); } /** @@ -502,11 +493,7 @@ private T readObject(QName startTagName, ReadValueCallback con "Expected XML element to be '" + startTagName + "' but it was: " + tagName + "'."); } - try { - return converter.read(this); - } catch (IOException ex) { - throw new XMLStreamException(ex); - } + return converter.read(this); } /** diff --git a/sdk/servicebus/azure-messaging-servicebus/pom.xml b/sdk/servicebus/azure-messaging-servicebus/pom.xml index de869f7c2554f..e794114c5a974 100644 --- a/sdk/servicebus/azure-messaging-servicebus/pom.xml +++ b/sdk/servicebus/azure-messaging-servicebus/pom.xml @@ -85,6 +85,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + com.azure azure-identity @@ -164,4 +170,21 @@ test + + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/WindowedSubscriberFluxWindowIsolatedTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/WindowedSubscriberFluxWindowIsolatedTest.java index 611d6b4dbd6cc..a78151e1bf010 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/WindowedSubscriberFluxWindowIsolatedTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/WindowedSubscriberFluxWindowIsolatedTest.java @@ -3,6 +3,7 @@ package com.azure.messaging.servicebus; +import com.azure.core.util.logging.ClientLogger; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Execution; @@ -19,6 +20,7 @@ import java.util.Deque; import java.util.List; import java.util.concurrent.ConcurrentLinkedDeque; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; import java.util.function.Supplier; @@ -33,6 +35,8 @@ @Execution(ExecutionMode.SAME_THREAD) @Isolated public final class WindowedSubscriberFluxWindowIsolatedTest { + private final ClientLogger logger = new ClientLogger(WindowedSubscriberFluxWindowIsolatedTest.class); + @Test @Execution(ExecutionMode.SAME_THREAD) public void shouldCloseEmptyWindowOnTimeout() { @@ -44,13 +48,14 @@ public void shouldCloseEmptyWindowOnTimeout() { upstream.subscribe(subscriber); final AtomicReference> rRef = new AtomicReference<>(); - final Supplier> scenario = () -> { - final EnqueueResult r = subscriber.enqueueRequestImpl(windowSize, windowTimeout); - rRef.set(r); - return r.getWindowFlux(); - }; - try (VirtualTimeStepVerifier verifier = new VirtualTimeStepVerifier()) { + final Supplier> scenario = () -> { + verifier.logIfClosedUnexpectedly(logger); + final EnqueueResult r = subscriber.enqueueRequestImpl(windowSize, windowTimeout); + rRef.set(r); + return r.getWindowFlux(); + }; + verifier.create(scenario) // Forward time to timeout empty windowTimeout. .thenAwait(windowTimeout.plusSeconds(10)) @@ -74,13 +79,14 @@ public void shouldCloseStreamingWindowOnTimeout() { upstream.subscribe(subscriber); final AtomicReference> rRef = new AtomicReference<>(); - final Supplier> scenario = () -> { - final EnqueueResult r = subscriber.enqueueRequestImpl(windowSize, windowTimeout); - rRef.set(r); - return r.getWindowFlux(); - }; - try (VirtualTimeStepVerifier verifier = new VirtualTimeStepVerifier()) { + final Supplier> scenario = () -> { + verifier.logIfClosedUnexpectedly(logger); + final EnqueueResult r = subscriber.enqueueRequestImpl(windowSize, windowTimeout); + rRef.set(r); + return r.getWindowFlux(); + }; + verifier.create(scenario) .then(() -> upstream.next(1)) .then(() -> upstream.next(2)) @@ -108,17 +114,18 @@ public void shouldContinueToNextWindowWhenEmptyWindowTimeout() { final AtomicReference> r0Ref = new AtomicReference<>(); final AtomicReference> r1Ref = new AtomicReference<>(); - final Supplier> scenario = () -> { - final EnqueueResult r0 = subscriber.enqueueRequestImpl(windowSize, windowTimeout); - final EnqueueResult r1 = subscriber.enqueueRequestImpl(windowSize, windowTimeout); - r0Ref.set(r0); - r1Ref.set(r1); - final Flux window0Flux = r0.getWindowFlux(); - final Flux window1Flux = r1.getWindowFlux(); - return window0Flux.concatWith(window1Flux); - }; - try (VirtualTimeStepVerifier verifier = new VirtualTimeStepVerifier()) { + final Supplier> scenario = () -> { + verifier.logIfClosedUnexpectedly(logger); + final EnqueueResult r0 = subscriber.enqueueRequestImpl(windowSize, windowTimeout); + final EnqueueResult r1 = subscriber.enqueueRequestImpl(windowSize, windowTimeout); + r0Ref.set(r0); + r1Ref.set(r1); + final Flux window0Flux = r0.getWindowFlux(); + final Flux window1Flux = r1.getWindowFlux(); + return window0Flux.concatWith(window1Flux); + }; + verifier.create(scenario) // Forward time to timeout empty window0Flux, .thenAwait(windowTimeout.plusSeconds(10)) @@ -154,17 +161,18 @@ public void shouldContinueToNextWindowWhenStreamingWindowTimeout() { final AtomicReference> r0Ref = new AtomicReference<>(); final AtomicReference> r1Ref = new AtomicReference<>(); - final Supplier> scenario = () -> { - final EnqueueResult r0 = subscriber.enqueueRequestImpl(windowSize, windowTimeout); - final EnqueueResult r1 = subscriber.enqueueRequestImpl(windowSize, windowTimeout); - r0Ref.set(r0); - r1Ref.set(r1); - final Flux window0Flux = r0.getWindowFlux(); - final Flux window1Flux = r1.getWindowFlux(); - return window0Flux.concatWith(window1Flux); - }; - try (VirtualTimeStepVerifier verifier = new VirtualTimeStepVerifier()) { + final Supplier> scenario = () -> { + verifier.logIfClosedUnexpectedly(logger); + final EnqueueResult r0 = subscriber.enqueueRequestImpl(windowSize, windowTimeout); + final EnqueueResult r1 = subscriber.enqueueRequestImpl(windowSize, windowTimeout); + r0Ref.set(r0); + r1Ref.set(r1); + final Flux window0Flux = r0.getWindowFlux(); + final Flux window1Flux = r1.getWindowFlux(); + return window0Flux.concatWith(window1Flux); + }; + verifier.create(scenario) .then(() -> upstream.next(1)) .then(() -> upstream.next(2)) @@ -186,9 +194,19 @@ public void shouldContinueToNextWindowWhenStreamingWindowTimeout() { Assertions.assertFalse(work0.isCanceled()); final WindowWork work1 = r1Ref.get().getInnerWork(); - Assertions.assertNotEquals(windowSize, work1.getPending()); Assertions.assertTrue(work1.hasTimedOut()); Assertions.assertFalse(work1.isCanceled()); + final boolean hasWindow1ReceivedNothing = work1.getPending() == windowSize; + if (hasWindow1ReceivedNothing) { + // The combination of VirtualTimeScheduler and WindowedSubscriber.drain() sometimes delays arrival of timeout + // signaling for window0, resulting window0 to timeout only after the emission of 3 (and 4). This result in + // window0 to receive 1, 2, 3 and 4, and window1 to receive nothing. Here asserting that, when/if this happens + // application still gets emitted events via window0. + // + final boolean hasWindow0ReceivedAll = work0.getPending() == windowSize - 4; // (demanded - received) + Assertions.assertTrue(hasWindow0ReceivedAll, + String.format("window0 pending: %d, window1 pending: %d", work0.getPending(), work1.getPending())); + } } @Test @@ -204,19 +222,20 @@ public void shouldContinueToNextWindowWhenStreamingWindowCancels() { final AtomicReference> r0Ref = new AtomicReference<>(); final AtomicReference> r1Ref = new AtomicReference<>(); - final Supplier> scenario = () -> { - final EnqueueResult r0 = subscriber.enqueueRequestImpl(windowSize, windowTimeout); - final EnqueueResult r1 = subscriber.enqueueRequestImpl(windowSize, windowTimeout); - r0Ref.set(r0); - r1Ref.set(r1); - final Flux window0Flux = r0.getWindowFlux(); - final Flux window1Flux = r1.getWindowFlux(); - return window0Flux - .take(cancelAfter) - .concatWith(window1Flux); - }; - try (VirtualTimeStepVerifier verifier = new VirtualTimeStepVerifier()) { + final Supplier> scenario = () -> { + verifier.logIfClosedUnexpectedly(logger); + final EnqueueResult r0 = subscriber.enqueueRequestImpl(windowSize, windowTimeout); + final EnqueueResult r1 = subscriber.enqueueRequestImpl(windowSize, windowTimeout); + r0Ref.set(r0); + r1Ref.set(r1); + final Flux window0Flux = r0.getWindowFlux(); + final Flux window1Flux = r1.getWindowFlux(); + return window0Flux + .take(cancelAfter) + .concatWith(window1Flux); + }; + verifier.create(scenario) .then(() -> upstream.next(1)) .then(() -> upstream.next(2)) @@ -248,13 +267,14 @@ public void shouldRequestWindowDemand() { upstream.subscribe(subscriber); final AtomicReference> rRef = new AtomicReference<>(); - final Supplier> scenario = () -> { - final EnqueueResult r = subscriber.enqueueRequestImpl(windowSize, windowTimeout); - rRef.set(r); - return r.getWindowFlux(); - }; - try (VirtualTimeStepVerifier verifier = new VirtualTimeStepVerifier()) { + final Supplier> scenario = () -> { + verifier.logIfClosedUnexpectedly(logger); + final EnqueueResult r = subscriber.enqueueRequestImpl(windowSize, windowTimeout); + rRef.set(r); + return r.getWindowFlux(); + }; + verifier.create(scenario) .thenAwait(windowTimeout.plusSeconds(10)) .verifyComplete(); @@ -279,18 +299,18 @@ public void shouldAccountPendingRequestWhenServingNextWindowDemand() { final AtomicReference> r0Ref = new AtomicReference<>(); final AtomicReference> r1Ref = new AtomicReference<>(); - final Supplier> scenario = () -> { - final EnqueueResult r0 = subscriber.enqueueRequestImpl(window0Size, windowTimeout); - final EnqueueResult r1 = subscriber.enqueueRequestImpl(window1Size, windowTimeout); - r0Ref.set(r0); - r1Ref.set(r1); - final Flux window0Flux = r0.getWindowFlux(); - final Flux window1Flux = r1.getWindowFlux(); - return window0Flux.concatWith(window1Flux); - }; - - try (VirtualTimeStepVerifier verifier = new VirtualTimeStepVerifier()) { + final Supplier> scenario = () -> { + verifier.logIfClosedUnexpectedly(logger); + final EnqueueResult r0 = subscriber.enqueueRequestImpl(window0Size, windowTimeout); + final EnqueueResult r1 = subscriber.enqueueRequestImpl(window1Size, windowTimeout); + r0Ref.set(r0); + r1Ref.set(r1); + final Flux window0Flux = r0.getWindowFlux(); + final Flux window1Flux = r1.getWindowFlux(); + return window0Flux.concatWith(window1Flux); + }; + verifier.create(scenario) // timeout window0Flux without receiving (so pending request become 'windowSize0'), and pick next work. .thenAwait(windowTimeout.plusSeconds(10)) @@ -322,17 +342,19 @@ public void shouldPickEnqueuedWindowRequestsOnSubscriptionReady() { final AtomicReference> r0Ref = new AtomicReference<>(); final AtomicReference> r1Ref = new AtomicReference<>(); - final Supplier> scenario = () -> { - final EnqueueResult r0 = subscriber.enqueueRequestImpl(window0Size, windowTimeout); - final EnqueueResult r1 = subscriber.enqueueRequestImpl(window1Size, windowTimeout); - r0Ref.set(r0); - r1Ref.set(r1); - final Flux window0Flux = r0.getWindowFlux(); - final Flux window1Flux = r1.getWindowFlux(); - return window0Flux.concatWith(window1Flux); - }; try (VirtualTimeStepVerifier verifier = new VirtualTimeStepVerifier()) { + final Supplier> scenario = () -> { + verifier.logIfClosedUnexpectedly(logger); + final EnqueueResult r0 = subscriber.enqueueRequestImpl(window0Size, windowTimeout); + final EnqueueResult r1 = subscriber.enqueueRequestImpl(window1Size, windowTimeout); + r0Ref.set(r0); + r1Ref.set(r1); + final Flux window0Flux = r0.getWindowFlux(); + final Flux window1Flux = r1.getWindowFlux(); + return window0Flux.concatWith(window1Flux); + }; + verifier.create(scenario) // subscribe after enqueuing requests in 'scenario' (mimicking late arrival of subscription). .then(() -> upstream.subscribe(subscriber)) @@ -366,14 +388,13 @@ public void shouldInvokeReleaserWhenNoWindowToService() { final WindowedSubscriber subscriber = createSubscriber(options.setReleaser(releaser)); upstream.subscribe(subscriber); - final AtomicReference> rRef = new AtomicReference<>(); - final Supplier> scenario = () -> { - final EnqueueResult r = subscriber.enqueueRequestImpl(windowSize, windowTimeout); - rRef.set(r); - return r.getWindowFlux(); - }; - try (VirtualTimeStepVerifier verifier = new VirtualTimeStepVerifier()) { + final Supplier> scenario = () -> { + verifier.logIfClosedUnexpectedly(logger); + final EnqueueResult r = subscriber.enqueueRequestImpl(windowSize, windowTimeout); + return r.getWindowFlux(); + }; + verifier.create(scenario) // forward time to timeout windowFlux without receiving. .thenAwait(windowTimeout.plusSeconds(10)) @@ -400,14 +421,13 @@ public void shouldStopInvokingReleaserOnUpstreamTermination() { final WindowedSubscriber subscriber = createSubscriber(options.setReleaser(releaser)); upstream.subscribe(subscriber); - final AtomicReference> rRef = new AtomicReference<>(); - final Supplier> scenario = () -> { - final EnqueueResult r = subscriber.enqueueRequestImpl(windowSize, windowTimeout); - rRef.set(r); - return r.getWindowFlux(); - }; - try (VirtualTimeStepVerifier verifier = new VirtualTimeStepVerifier()) { + final Supplier> scenario = () -> { + verifier.logIfClosedUnexpectedly(logger); + final EnqueueResult r = subscriber.enqueueRequestImpl(windowSize, windowTimeout); + return r.getWindowFlux(); + }; + verifier.create(scenario) // forward time to timeout windowFlux without receiving. .thenAwait(windowTimeout.plusSeconds(10)) @@ -424,10 +444,11 @@ public void shouldStopInvokingReleaserOnUpstreamTermination() { Assertions.assertEquals(Arrays.asList(1, 2), released); } - private static final class VirtualTimeStepVerifier implements AutoCloseable { + private static final class VirtualTimeStepVerifier extends AtomicBoolean implements AutoCloseable { private final VirtualTimeScheduler scheduler; VirtualTimeStepVerifier() { + super(false); scheduler = VirtualTimeScheduler.create(); } @@ -437,8 +458,21 @@ StepVerifier.Step create(Supplier> scenarioSupplier) { @Override public void close() { + super.set(true); scheduler.dispose(); } + + void logIfClosedUnexpectedly(ClientLogger logger) { + final boolean wasAutoClosed = get(); + final boolean isSchedulerDisposed = scheduler.isDisposed(); + if (wasAutoClosed || isSchedulerDisposed) { + if (!wasAutoClosed) { + logger.atError().log("VirtualTimeScheduler unavailable (unexpected close from outside of the test)."); + } else { + logger.atError().log("VirtualTimeScheduler unavailable (unexpected close by the test)."); + } + } + } } private static class Releaser implements Consumer { diff --git a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/WindowedSubscriberIterableWindowTest.java b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/WindowedSubscriberIterableWindowTest.java index e8d685dc8730d..524b1bc82ff3b 100644 --- a/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/WindowedSubscriberIterableWindowTest.java +++ b/sdk/servicebus/azure-messaging-servicebus/src/test/java/com/azure/messaging/servicebus/WindowedSubscriberIterableWindowTest.java @@ -655,7 +655,8 @@ public void shouldContinueToNextWindowOnEmptyWindowTimeout() { final IterableStream window0Iterable = r0.getWindowIterable(); final IterableStream window1Iterable = r1.getWindowIterable(); - + // When time out triggers, it will close the window0Iterable stream, which will end the blocking collect() call + // by returning "empty" list since "no events were received" within the timeout. final List list0 = window0Iterable.stream().collect(Collectors.toList()); Assertions.assertEquals(0, list0.size()); @@ -694,6 +695,8 @@ public void shouldContinueToNextWindowWhenStreamingWindowTimeout() { upstream.next(1); upstream.next(2); + // When time out triggers, it will close the window0Iterable stream, which will end the blocking collect() call + // and return the list, list0, with events received so far (which is less than demanded). final List list0 = window0Iterable.stream().collect(Collectors.toList()); Assertions.assertEquals(Arrays.asList(1, 2), list0); diff --git a/sdk/sphere/azure-resourcemanager-sphere/CHANGELOG.md b/sdk/sphere/azure-resourcemanager-sphere/CHANGELOG.md index db7567eac8ac1..5a13d46e2c228 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/CHANGELOG.md +++ b/sdk/sphere/azure-resourcemanager-sphere/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.1.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,312 @@ ### Other Changes +## 1.0.0 (2024-03-26) + +- Azure Resource Manager AzureSphere client library for Java. This package contains Microsoft Azure SDK for AzureSphere Management SDK. Azure Sphere resource management API. Package tag package-2024-04-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +### Breaking Changes + +#### `models.CountDeviceResponse` was modified + +* `value()` was removed +* `innerModel()` was removed + +#### `models.Product$Definition` was modified + +* `withDescription(java.lang.String)` was removed + +#### `models.ImageListResult` was modified + +* `withNextLink(java.lang.String)` was removed + +#### `models.PagedDeviceInsight` was modified + +* `withNextLink(java.lang.String)` was removed + +#### `AzureSphereManager` was modified + +* `fluent.AzureSphereManagementClient serviceClient()` -> `fluent.AzureSphereMgmtClient serviceClient()` + +#### `models.DeviceGroup$Update` was modified + +* `withAllowCrashDumpsCollection(models.AllowCrashDumpCollection)` was removed +* `withDescription(java.lang.String)` was removed +* `withUpdatePolicy(models.UpdatePolicy)` was removed +* `withOsFeedType(models.OSFeedType)` was removed +* `withRegionalDataBoundary(models.RegionalDataBoundary)` was removed + +#### `models.DeviceGroupListResult` was modified + +* `withNextLink(java.lang.String)` was removed + +#### `models.Catalogs` was modified + +* `models.CountDeviceResponse countDevices(java.lang.String,java.lang.String)` -> `models.CountDevicesResponse countDevices(java.lang.String,java.lang.String)` + +#### `models.DeploymentListResult` was modified + +* `withNextLink(java.lang.String)` was removed + +#### `models.Device$Definition` was modified + +* `withDeviceId(java.lang.String)` was removed + +#### `models.Catalog` was modified + +* `provisioningState()` was removed +* `models.CountDeviceResponse countDevices()` -> `models.CountDevicesResponse countDevices()` + +#### `models.Device` was modified + +* `chipSku()` was removed +* `provisioningState()` was removed +* `lastAvailableOsVersion()` was removed +* `lastOsUpdateUtc()` was removed +* `deviceId()` was removed +* `lastUpdateRequestUtc()` was removed +* `lastInstalledOsVersion()` was removed + +#### `models.Product$Update` was modified + +* `withDescription(java.lang.String)` was removed + +#### `models.ProductListResult` was modified + +* `withNextLink(java.lang.String)` was removed + +#### `models.DeviceGroup$Definition` was modified + +* `withAllowCrashDumpsCollection(models.AllowCrashDumpCollection)` was removed +* `withDescription(java.lang.String)` was removed +* `withUpdatePolicy(models.UpdatePolicy)` was removed +* `withRegionalDataBoundary(models.RegionalDataBoundary)` was removed +* `withOsFeedType(models.OSFeedType)` was removed + +#### `models.DeviceGroup` was modified + +* `osFeedType()` was removed +* `models.CountDeviceResponse countDevices()` -> `models.CountDevicesResponse countDevices()` +* `provisioningState()` was removed +* `hasDeployment()` was removed +* `allowCrashDumpsCollection()` was removed +* `regionalDataBoundary()` was removed +* `description()` was removed +* `updatePolicy()` was removed + +#### `models.DeviceUpdate` was modified + +* `withDeviceGroupId(java.lang.String)` was removed +* `deviceGroupId()` was removed + +#### `models.CatalogListResult` was modified + +* `withNextLink(java.lang.String)` was removed + +#### `models.DeviceListResult` was modified + +* `withNextLink(java.lang.String)` was removed + +#### `models.Product` was modified + +* `description()` was removed +* `models.CountDeviceResponse countDevices()` -> `models.CountDevicesResponse countDevices()` +* `provisioningState()` was removed + +#### `models.Device$Update` was modified + +* `withDeviceGroupId(java.lang.String)` was removed + +#### `models.Image$Definition` was modified + +* `withRegionalDataBoundary(models.RegionalDataBoundary)` was removed +* `withImage(java.lang.String)` was removed +* `withImageId(java.lang.String)` was removed + +#### `models.Deployment` was modified + +* `deploymentId()` was removed +* `deploymentDateUtc()` was removed +* `provisioningState()` was removed +* `deployedImages()` was removed + +#### `models.DeviceGroups` was modified + +* `models.CountDeviceResponse countDevices(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` -> `models.CountDevicesResponse countDevices(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` + +#### `models.Products` was modified + +* `models.CountDeviceResponse countDevices(java.lang.String,java.lang.String,java.lang.String)` -> `models.CountDevicesResponse countDevices(java.lang.String,java.lang.String,java.lang.String)` + +#### `models.ProductUpdate` was modified + +* `withDescription(java.lang.String)` was removed +* `description()` was removed + +#### `models.DeviceGroupUpdate` was modified + +* `regionalDataBoundary()` was removed +* `withRegionalDataBoundary(models.RegionalDataBoundary)` was removed +* `allowCrashDumpsCollection()` was removed +* `updatePolicy()` was removed +* `withAllowCrashDumpsCollection(models.AllowCrashDumpCollection)` was removed +* `withOsFeedType(models.OSFeedType)` was removed +* `withUpdatePolicy(models.UpdatePolicy)` was removed +* `withDescription(java.lang.String)` was removed +* `description()` was removed +* `osFeedType()` was removed + +#### `models.CertificateListResult` was modified + +* `withNextLink(java.lang.String)` was removed + +#### `models.Image` was modified + +* `regionalDataBoundary()` was removed +* `image()` was removed +* `provisioningState()` was removed +* `uri()` was removed +* `imageName()` was removed +* `imageId()` was removed +* `description()` was removed +* `componentId()` was removed +* `imageType()` was removed + +#### `models.Deployment$Definition` was modified + +* `withDeploymentId(java.lang.String)` was removed +* `withDeployedImages(java.util.List)` was removed + +#### `models.Certificate` was modified + +* `notBeforeUtc()` was removed +* `subject()` was removed +* `expiryUtc()` was removed +* `certificate()` was removed +* `thumbprint()` was removed +* `provisioningState()` was removed +* `status()` was removed + +### Features Added + +* `models.DeviceGroupProperties` was added + +* `models.DeviceProperties` was added + +* `models.CertificateProperties` was added + +* `models.CountDevicesResponse` was added + +* `models.DeploymentProperties` was added + +* `models.DeviceUpdateProperties` was added + +* `models.DeviceGroupUpdateProperties` was added + +* `models.CatalogProperties` was added + +* `models.ProductUpdateProperties` was added + +* `models.ImageProperties` was added + +* `models.ProductProperties` was added + +#### `models.CountDeviceResponse` was modified + +* `withValue(int)` was added +* `validate()` was added + +#### `models.Product$Definition` was modified + +* `withProperties(models.ProductProperties)` was added + +#### `models.DeviceGroup$Update` was modified + +* `withProperties(models.DeviceGroupUpdateProperties)` was added + +#### `models.Catalogs` was modified + +* `uploadImage(java.lang.String,java.lang.String,fluent.models.ImageInner,com.azure.core.util.Context)` was added +* `uploadImage(java.lang.String,java.lang.String,fluent.models.ImageInner)` was added + +#### `models.Device$Definition` was modified + +* `withProperties(models.DeviceProperties)` was added + +#### `models.Catalog` was modified + +* `uploadImage(fluent.models.ImageInner,com.azure.core.util.Context)` was added +* `properties()` was added +* `uploadImage(fluent.models.ImageInner)` was added + +#### `models.Device` was modified + +* `systemData()` was added +* `properties()` was added + +#### `models.Product$Update` was modified + +* `withProperties(models.ProductUpdateProperties)` was added + +#### `models.DeviceGroup$Definition` was modified + +* `withProperties(models.DeviceGroupProperties)` was added + +#### `models.DeviceGroup` was modified + +* `properties()` was added +* `systemData()` was added + +#### `models.DeviceUpdate` was modified + +* `properties()` was added +* `withProperties(models.DeviceUpdateProperties)` was added + +#### `models.Product` was modified + +* `properties()` was added +* `systemData()` was added + +#### `models.Device$Update` was modified + +* `withProperties(models.DeviceUpdateProperties)` was added + +#### `models.Image$Definition` was modified + +* `withProperties(models.ImageProperties)` was added + +#### `models.Deployment` was modified + +* `systemData()` was added +* `properties()` was added + +#### `models.ProductUpdate` was modified + +* `withProperties(models.ProductUpdateProperties)` was added +* `properties()` was added + +#### `models.DeviceGroupUpdate` was modified + +* `withProperties(models.DeviceGroupUpdateProperties)` was added +* `properties()` was added + +#### `models.Catalog$Definition` was modified + +* `withProperties(models.CatalogProperties)` was added + +#### `models.Image` was modified + +* `systemData()` was added +* `properties()` was added + +#### `models.Deployment$Definition` was modified + +* `withProperties(models.DeploymentProperties)` was added + +#### `models.Certificate` was modified + +* `properties()` was added + ## 1.0.0-beta.1 (2023-07-21) - Azure Resource Manager AzureSphere client library for Java. This package contains Microsoft Azure SDK for AzureSphere Management SDK. Azure Sphere resource management API. Package tag package-2022-09-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/sphere/azure-resourcemanager-sphere/README.md b/sdk/sphere/azure-resourcemanager-sphere/README.md index 2c270ea9f71a9..8918acb6fd371 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/README.md +++ b/sdk/sphere/azure-resourcemanager-sphere/README.md @@ -2,7 +2,7 @@ Azure Resource Manager AzureSphere client library for Java. -This package contains Microsoft Azure SDK for AzureSphere Management SDK. Azure Sphere resource management API. Package tag package-2022-09-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for AzureSphere Management SDK. Azure Sphere resource management API. Package tag package-2024-04-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-sphere - 1.0.0-beta.1 + 1.0.0 ``` [//]: # ({x-version-update-end}) @@ -45,7 +45,7 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. +By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. @@ -94,7 +94,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS [docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [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 diff --git a/sdk/sphere/azure-resourcemanager-sphere/SAMPLE.md b/sdk/sphere/azure-resourcemanager-sphere/SAMPLE.md index 5bf2b6bf9674a..0f9c9ae9fc3c8 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/SAMPLE.md +++ b/sdk/sphere/azure-resourcemanager-sphere/SAMPLE.md @@ -14,6 +14,7 @@ - [ListDeviceInsights](#catalogs_listdeviceinsights) - [ListDevices](#catalogs_listdevices) - [Update](#catalogs_update) +- [UploadImage](#catalogs_uploadimage) ## Certificates @@ -71,14 +72,18 @@ ### Catalogs_CountDevices ```java -/** Samples for Catalogs CountDevices. */ +/** + * Samples for Catalogs CountDevices. + */ public final class CatalogsCountDevicesSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesCatalog.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostCountDevicesCatalog. + * json */ /** * Sample code: Catalogs_CountDevices. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsCountDevices(com.azure.resourcemanager.sphere.AzureSphereManager manager) { @@ -90,22 +95,21 @@ public final class CatalogsCountDevicesSamples { ### Catalogs_CreateOrUpdate ```java -/** Samples for Catalogs CreateOrUpdate. */ +/** + * Samples for Catalogs CreateOrUpdate. + */ public final class CatalogsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutCatalog.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutCatalog.json */ /** * Sample code: Catalogs_CreateOrUpdate. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsCreateOrUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .catalogs() - .define("MyCatalog1") - .withRegion("global") - .withExistingResourceGroup("MyResourceGroup1") + manager.catalogs().define("MyCatalog1").withRegion("global").withExistingResourceGroup("MyResourceGroup1") .create(); } } @@ -114,14 +118,17 @@ public final class CatalogsCreateOrUpdateSamples { ### Catalogs_Delete ```java -/** Samples for Catalogs Delete. */ +/** + * Samples for Catalogs Delete. + */ public final class CatalogsDeleteSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteCatalog.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteCatalog.json */ /** * Sample code: Catalogs_Delete. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsDelete(com.azure.resourcemanager.sphere.AzureSphereManager manager) { @@ -133,20 +140,22 @@ public final class CatalogsDeleteSamples { ### Catalogs_GetByResourceGroup ```java -/** Samples for Catalogs GetByResourceGroup. */ +/** + * Samples for Catalogs GetByResourceGroup. + */ public final class CatalogsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalog.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCatalog.json */ /** * Sample code: Catalogs_Get. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsGet(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .catalogs() - .getByResourceGroupWithResponse("MyResourceGroup1", "MyCatalog1", com.azure.core.util.Context.NONE); + manager.catalogs().getByResourceGroupWithResponse("MyResourceGroup1", "MyCatalog1", + com.azure.core.util.Context.NONE); } } ``` @@ -154,14 +163,17 @@ public final class CatalogsGetByResourceGroupSamples { ### Catalogs_List ```java -/** Samples for Catalogs List. */ +/** + * Samples for Catalogs List. + */ public final class CatalogsListSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalogsSub.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCatalogsSub.json */ /** * Sample code: Catalogs_ListBySubscription. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsListBySubscription(com.azure.resourcemanager.sphere.AzureSphereManager manager) { @@ -173,14 +185,17 @@ public final class CatalogsListSamples { ### Catalogs_ListByResourceGroup ```java -/** Samples for Catalogs ListByResourceGroup. */ +/** + * Samples for Catalogs ListByResourceGroup. + */ public final class CatalogsListByResourceGroupSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalogsRG.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCatalogsRG.json */ /** * Sample code: Catalogs_ListByResourceGroup. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsListByResourceGroup(com.azure.resourcemanager.sphere.AzureSphereManager manager) { @@ -192,21 +207,22 @@ public final class CatalogsListByResourceGroupSamples { ### Catalogs_ListDeployments ```java -/** Samples for Catalogs ListDeployments. */ +/** + * Samples for Catalogs ListDeployments. + */ public final class CatalogsListDeploymentsSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeploymentsByCatalog.json + * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ + * PostListDeploymentsByCatalog.json */ /** * Sample code: Catalogs_ListDeployments. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsListDeployments(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .catalogs() - .listDeployments( - "MyResourceGroup1", "MyCatalog1", null, null, null, null, com.azure.core.util.Context.NONE); + manager.catalogs().listDeployments("MyResourceGroup1", "MyCatalog1", null, null, null, null, + com.azure.core.util.Context.NONE); } } ``` @@ -216,28 +232,23 @@ public final class CatalogsListDeploymentsSamples { ```java import com.azure.resourcemanager.sphere.models.ListDeviceGroupsRequest; -/** Samples for Catalogs ListDeviceGroups. */ +/** + * Samples for Catalogs ListDeviceGroups. + */ public final class CatalogsListDeviceGroupsSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeviceGroupsCatalog.json + * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ + * PostListDeviceGroupsCatalog.json */ /** * Sample code: Catalogs_ListDeviceGroups. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsListDeviceGroups(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .catalogs() - .listDeviceGroups( - "MyResourceGroup1", - "MyCatalog1", - new ListDeviceGroupsRequest().withDeviceGroupName("MyDeviceGroup1"), - null, - null, - null, - null, - com.azure.core.util.Context.NONE); + manager.catalogs().listDeviceGroups("MyResourceGroup1", "MyCatalog1", + new ListDeviceGroupsRequest().withDeviceGroupName("MyDeviceGroup1"), null, null, null, null, + com.azure.core.util.Context.NONE); } } ``` @@ -245,21 +256,22 @@ public final class CatalogsListDeviceGroupsSamples { ### Catalogs_ListDeviceInsights ```java -/** Samples for Catalogs ListDeviceInsights. */ +/** + * Samples for Catalogs ListDeviceInsights. + */ public final class CatalogsListDeviceInsightsSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeviceInsightsCatalog.json + * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ + * PostListDeviceInsightsCatalog.json */ /** * Sample code: Catalogs_ListDeviceInsights. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsListDeviceInsights(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .catalogs() - .listDeviceInsights( - "MyResourceGroup1", "MyCatalog1", null, 10, null, null, com.azure.core.util.Context.NONE); + manager.catalogs().listDeviceInsights("MyResourceGroup1", "MyCatalog1", null, 10, null, null, + com.azure.core.util.Context.NONE); } } ``` @@ -267,20 +279,23 @@ public final class CatalogsListDeviceInsightsSamples { ### Catalogs_ListDevices ```java -/** Samples for Catalogs ListDevices. */ +/** + * Samples for Catalogs ListDevices. + */ public final class CatalogsListDevicesSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDevicesByCatalog.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostListDevicesByCatalog. + * json */ /** * Sample code: Catalogs_ListDevices. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsListDevices(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .catalogs() - .listDevices("MyResourceGroup1", "MyCatalog1", null, null, null, null, com.azure.core.util.Context.NONE); + manager.catalogs().listDevices("MyResourceGroup1", "MyCatalog1", null, null, null, null, + com.azure.core.util.Context.NONE); } } ``` @@ -290,44 +305,75 @@ public final class CatalogsListDevicesSamples { ```java import com.azure.resourcemanager.sphere.models.Catalog; -/** Samples for Catalogs Update. */ +/** + * Samples for Catalogs Update. + */ public final class CatalogsUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchCatalog.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchCatalog.json */ /** * Sample code: Catalogs_Update. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - Catalog resource = - manager - .catalogs() - .getByResourceGroupWithResponse("MyResourceGroup1", "MyCatalog1", com.azure.core.util.Context.NONE) - .getValue(); + Catalog resource = manager.catalogs() + .getByResourceGroupWithResponse("MyResourceGroup1", "MyCatalog1", com.azure.core.util.Context.NONE) + .getValue(); resource.update().apply(); } } ``` +### Catalogs_UploadImage + +```java +import com.azure.resourcemanager.sphere.fluent.models.ImageInner; +import com.azure.resourcemanager.sphere.models.ImageProperties; + +/** + * Samples for Catalogs UploadImage. + */ +public final class CatalogsUploadImageSamples { + /* + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostUploadImageCatalog. + * json + */ + /** + * Sample code: Catalogs_UploadImage. + * + * @param manager Entry point to AzureSphereManager. + */ + public static void catalogsUploadImage(com.azure.resourcemanager.sphere.AzureSphereManager manager) { + manager.catalogs().uploadImage("MyResourceGroup1", "MyCatalog1", + new ImageInner().withProperties(new ImageProperties().withImage("bXliYXNlNjRzdHJpbmc=")), + com.azure.core.util.Context.NONE); + } +} +``` + ### Certificates_Get ```java -/** Samples for Certificates Get. */ +/** + * Samples for Certificates Get. + */ public final class CertificatesGetSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCertificate.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCertificate.json */ /** * Sample code: Certificates_Get. - * + * * @param manager Entry point to AzureSphereManager. */ public static void certificatesGet(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .certificates() - .getWithResponse("MyResourceGroup1", "MyCatalog1", "default", com.azure.core.util.Context.NONE); + manager.certificates().getWithResponse("MyResourceGroup1", "MyCatalog1", "default", + com.azure.core.util.Context.NONE); } } ``` @@ -335,20 +381,22 @@ public final class CertificatesGetSamples { ### Certificates_ListByCatalog ```java -/** Samples for Certificates ListByCatalog. */ +/** + * Samples for Certificates ListByCatalog. + */ public final class CertificatesListByCatalogSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCertificates.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCertificates.json */ /** * Sample code: Certificates_ListByCatalog. - * + * * @param manager Entry point to AzureSphereManager. */ public static void certificatesListByCatalog(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .certificates() - .listByCatalog("MyResourceGroup1", "MyCatalog1", null, null, null, null, com.azure.core.util.Context.NONE); + manager.certificates().listByCatalog("MyResourceGroup1", "MyCatalog1", null, null, null, null, + com.azure.core.util.Context.NONE); } } ``` @@ -356,21 +404,22 @@ public final class CertificatesListByCatalogSamples { ### Certificates_RetrieveCertChain ```java -/** Samples for Certificates RetrieveCertChain. */ +/** + * Samples for Certificates RetrieveCertChain. + */ public final class CertificatesRetrieveCertChainSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostRetrieveCatalogCertChain.json + * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ + * PostRetrieveCatalogCertChain.json */ /** * Sample code: Certificates_RetrieveCertChain. - * + * * @param manager Entry point to AzureSphereManager. */ public static void certificatesRetrieveCertChain(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .certificates() - .retrieveCertChainWithResponse( - "MyResourceGroup1", "MyCatalog1", "active", com.azure.core.util.Context.NONE); + manager.certificates().retrieveCertChainWithResponse("MyResourceGroup1", "MyCatalog1", "active", + com.azure.core.util.Context.NONE); } } ``` @@ -380,26 +429,24 @@ public final class CertificatesRetrieveCertChainSamples { ```java import com.azure.resourcemanager.sphere.models.ProofOfPossessionNonceRequest; -/** Samples for Certificates RetrieveProofOfPossessionNonce. */ +/** + * Samples for Certificates RetrieveProofOfPossessionNonce. + */ public final class CertificatesRetrieveProofOfPossessionNonceSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostRetrieveProofOfPossessionNonce.json + * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ + * PostRetrieveProofOfPossessionNonce.json */ /** * Sample code: Certificates_RetrieveProofOfPossessionNonce. - * + * * @param manager Entry point to AzureSphereManager. */ - public static void certificatesRetrieveProofOfPossessionNonce( - com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .certificates() - .retrieveProofOfPossessionNonceWithResponse( - "MyResourceGroup1", - "MyCatalog1", - "active", - new ProofOfPossessionNonceRequest().withProofOfPossessionNonce("proofOfPossessionNonce"), - com.azure.core.util.Context.NONE); + public static void + certificatesRetrieveProofOfPossessionNonce(com.azure.resourcemanager.sphere.AzureSphereManager manager) { + manager.certificates().retrieveProofOfPossessionNonceWithResponse("MyResourceGroup1", "MyCatalog1", "active", + new ProofOfPossessionNonceRequest().withProofOfPossessionNonce("proofOfPossessionNonce"), + com.azure.core.util.Context.NONE); } } ``` @@ -407,22 +454,22 @@ public final class CertificatesRetrieveProofOfPossessionNonceSamples { ### Deployments_CreateOrUpdate ```java -/** Samples for Deployments CreateOrUpdate. */ +/** + * Samples for Deployments CreateOrUpdate. + */ public final class DeploymentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDeployment.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutDeployment.json */ /** * Sample code: Deployments_CreateOrUpdate. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deploymentsCreateOrUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deployments() - .define("MyDeployment1") - .withExistingDeviceGroup("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1") - .create(); + manager.deployments().define("MyDeployment1") + .withExistingDeviceGroup("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1").create(); } } ``` @@ -430,26 +477,22 @@ public final class DeploymentsCreateOrUpdateSamples { ### Deployments_Delete ```java -/** Samples for Deployments Delete. */ +/** + * Samples for Deployments Delete. + */ public final class DeploymentsDeleteSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDeployment.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteDeployment.json */ /** * Sample code: Deployments_Delete. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deploymentsDelete(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deployments() - .delete( - "MyResourceGroup1", - "MyCatalog1", - "MyProductName1", - "DeviceGroupName1", - "MyDeploymentName1", - com.azure.core.util.Context.NONE); + manager.deployments().delete("MyResourceGroup1", "MyCatalog1", "MyProductName1", "DeviceGroupName1", + "MyDeploymentName1", com.azure.core.util.Context.NONE); } } ``` @@ -457,26 +500,22 @@ public final class DeploymentsDeleteSamples { ### Deployments_Get ```java -/** Samples for Deployments Get. */ +/** + * Samples for Deployments Get. + */ public final class DeploymentsGetSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeployment.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeployment.json */ /** * Sample code: Deployments_Get. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deploymentsGet(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deployments() - .getWithResponse( - "MyResourceGroup1", - "MyCatalog1", - "MyProduct1", - "myDeviceGroup1", - "MyDeployment1", - com.azure.core.util.Context.NONE); + manager.deployments().getWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1", + "MyDeployment1", com.azure.core.util.Context.NONE); } } ``` @@ -484,29 +523,22 @@ public final class DeploymentsGetSamples { ### Deployments_ListByDeviceGroup ```java -/** Samples for Deployments ListByDeviceGroup. */ +/** + * Samples for Deployments ListByDeviceGroup. + */ public final class DeploymentsListByDeviceGroupSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeployments.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeployments.json */ /** * Sample code: Deployments_ListByDeviceGroup. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deploymentsListByDeviceGroup(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deployments() - .listByDeviceGroup( - "MyResourceGroup1", - "MyCatalog1", - "MyProduct1", - "myDeviceGroup1", - null, - null, - null, - null, - com.azure.core.util.Context.NONE); + manager.deployments().listByDeviceGroup("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1", null, + null, null, null, com.azure.core.util.Context.NONE); } } ``` @@ -517,30 +549,24 @@ public final class DeploymentsListByDeviceGroupSamples { import com.azure.resourcemanager.sphere.models.ClaimDevicesRequest; import java.util.Arrays; -/** Samples for DeviceGroups ClaimDevices. */ +/** + * Samples for DeviceGroups ClaimDevices. + */ public final class DeviceGroupsClaimDevicesSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostClaimDevices.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostClaimDevices.json */ /** * Sample code: DeviceGroups_ClaimDevices. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deviceGroupsClaimDevices(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deviceGroups() - .claimDevices( - "MyResourceGroup1", - "MyCatalog1", - "MyProduct1", - "MyDeviceGroup1", - new ClaimDevicesRequest() - .withDeviceIdentifiers( - Arrays - .asList( - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")), - com.azure.core.util.Context.NONE); + manager.deviceGroups().claimDevices("MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", + new ClaimDevicesRequest().withDeviceIdentifiers(Arrays.asList( + "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")), + com.azure.core.util.Context.NONE); } } ``` @@ -548,21 +574,22 @@ public final class DeviceGroupsClaimDevicesSamples { ### DeviceGroups_CountDevices ```java -/** Samples for DeviceGroups CountDevices. */ +/** + * Samples for DeviceGroups CountDevices. + */ public final class DeviceGroupsCountDevicesSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesDeviceGroup.json + * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ + * PostCountDevicesDeviceGroup.json */ /** * Sample code: DeviceGroups_CountDevices. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deviceGroupsCountDevices(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deviceGroups() - .countDevicesWithResponse( - "MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", com.azure.core.util.Context.NONE); + manager.deviceGroups().countDevicesWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", + "MyDeviceGroup1", com.azure.core.util.Context.NONE); } } ``` @@ -570,27 +597,28 @@ public final class DeviceGroupsCountDevicesSamples { ### DeviceGroups_CreateOrUpdate ```java +import com.azure.resourcemanager.sphere.models.DeviceGroupProperties; import com.azure.resourcemanager.sphere.models.OSFeedType; import com.azure.resourcemanager.sphere.models.UpdatePolicy; -/** Samples for DeviceGroups CreateOrUpdate. */ +/** + * Samples for DeviceGroups CreateOrUpdate. + */ public final class DeviceGroupsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDeviceGroup.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutDeviceGroup.json */ /** * Sample code: DeviceGroups_CreateOrUpdate. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deviceGroupsCreateOrUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deviceGroups() - .define("MyDeviceGroup1") + manager.deviceGroups().define("MyDeviceGroup1") .withExistingProduct("MyResourceGroup1", "MyCatalog1", "MyProduct1") - .withDescription("Description for MyDeviceGroup1") - .withOsFeedType(OSFeedType.RETAIL) - .withUpdatePolicy(UpdatePolicy.UPDATE_ALL) + .withProperties(new DeviceGroupProperties().withDescription("Description for MyDeviceGroup1") + .withOsFeedType(OSFeedType.RETAIL).withUpdatePolicy(UpdatePolicy.UPDATE_ALL)) .create(); } } @@ -599,20 +627,22 @@ public final class DeviceGroupsCreateOrUpdateSamples { ### DeviceGroups_Delete ```java -/** Samples for DeviceGroups Delete. */ +/** + * Samples for DeviceGroups Delete. + */ public final class DeviceGroupsDeleteSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDeviceGroup.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteDeviceGroup.json */ /** * Sample code: DeviceGroups_Delete. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deviceGroupsDelete(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deviceGroups() - .delete("MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", com.azure.core.util.Context.NONE); + manager.deviceGroups().delete("MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", + com.azure.core.util.Context.NONE); } } ``` @@ -620,21 +650,22 @@ public final class DeviceGroupsDeleteSamples { ### DeviceGroups_Get ```java -/** Samples for DeviceGroups Get. */ +/** + * Samples for DeviceGroups Get. + */ public final class DeviceGroupsGetSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeviceGroup.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeviceGroup.json */ /** * Sample code: DeviceGroups_Get. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deviceGroupsGet(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deviceGroups() - .getWithResponse( - "MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", com.azure.core.util.Context.NONE); + manager.deviceGroups().getWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", + com.azure.core.util.Context.NONE); } } ``` @@ -642,28 +673,22 @@ public final class DeviceGroupsGetSamples { ### DeviceGroups_ListByProduct ```java -/** Samples for DeviceGroups ListByProduct. */ +/** + * Samples for DeviceGroups ListByProduct. + */ public final class DeviceGroupsListByProductSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeviceGroups.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeviceGroups.json */ /** * Sample code: DeviceGroups_ListByProduct. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deviceGroupsListByProduct(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deviceGroups() - .listByProduct( - "MyResourceGroup1", - "MyCatalog1", - "MyProduct1", - null, - null, - null, - null, - com.azure.core.util.Context.NONE); + manager.deviceGroups().listByProduct("MyResourceGroup1", "MyCatalog1", "MyProduct1", null, null, null, null, + com.azure.core.util.Context.NONE); } } ``` @@ -673,23 +698,22 @@ public final class DeviceGroupsListByProductSamples { ```java import com.azure.resourcemanager.sphere.models.DeviceGroup; -/** Samples for DeviceGroups Update. */ +/** + * Samples for DeviceGroups Update. + */ public final class DeviceGroupsUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchDeviceGroup.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchDeviceGroup.json */ /** * Sample code: DeviceGroups_Update. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deviceGroupsUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - DeviceGroup resource = - manager - .deviceGroups() - .getWithResponse( - "MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", com.azure.core.util.Context.NONE) - .getValue(); + DeviceGroup resource = manager.deviceGroups().getWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", + "MyDeviceGroup1", com.azure.core.util.Context.NONE).getValue(); resource.update().apply(); } } @@ -698,23 +722,23 @@ public final class DeviceGroupsUpdateSamples { ### Devices_CreateOrUpdate ```java -/** Samples for Devices CreateOrUpdate. */ +/** + * Samples for Devices CreateOrUpdate. + */ public final class DevicesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDevice.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutDevice.json */ /** * Sample code: Devices_CreateOrUpdate. - * + * * @param manager Entry point to AzureSphereManager. */ public static void devicesCreateOrUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .devices() - .define( - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") - .withExistingDeviceGroup("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1") - .create(); + manager.devices().define( + "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") + .withExistingDeviceGroup("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1").create(); } } ``` @@ -722,26 +746,23 @@ public final class DevicesCreateOrUpdateSamples { ### Devices_Delete ```java -/** Samples for Devices Delete. */ +/** + * Samples for Devices Delete. + */ public final class DevicesDeleteSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDevice.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteDevice.json */ /** * Sample code: Devices_Delete. - * + * * @param manager Entry point to AzureSphereManager. */ public static void devicesDelete(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .devices() - .delete( - "MyResourceGroup1", - "MyCatalog1", - "MyProductName1", - "DeviceGroupName1", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - com.azure.core.util.Context.NONE); + manager.devices().delete("MyResourceGroup1", "MyCatalog1", "MyProductName1", "DeviceGroupName1", + "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + com.azure.core.util.Context.NONE); } } ``` @@ -753,28 +774,25 @@ import com.azure.resourcemanager.sphere.models.CapabilityType; import com.azure.resourcemanager.sphere.models.GenerateCapabilityImageRequest; import java.util.Arrays; -/** Samples for Devices GenerateCapabilityImage. */ +/** + * Samples for Devices GenerateCapabilityImage. + */ public final class DevicesGenerateCapabilityImageSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostGenerateDeviceCapabilityImage.json + * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ + * PostGenerateDeviceCapabilityImage.json */ /** * Sample code: Devices_GenerateCapabilityImage. - * + * * @param manager Entry point to AzureSphereManager. */ public static void devicesGenerateCapabilityImage(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .devices() - .generateCapabilityImage( - "MyResourceGroup1", - "MyCatalog1", - "MyProduct1", - "myDeviceGroup1", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - new GenerateCapabilityImageRequest() - .withCapabilities(Arrays.asList(CapabilityType.APPLICATION_DEVELOPMENT)), - com.azure.core.util.Context.NONE); + manager.devices().generateCapabilityImage("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1", + "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + new GenerateCapabilityImageRequest().withCapabilities( + Arrays.asList(CapabilityType.APPLICATION_DEVELOPMENT)), + com.azure.core.util.Context.NONE); } } ``` @@ -782,26 +800,23 @@ public final class DevicesGenerateCapabilityImageSamples { ### Devices_Get ```java -/** Samples for Devices Get. */ +/** + * Samples for Devices Get. + */ public final class DevicesGetSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDevice.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDevice.json */ /** * Sample code: Devices_Get. - * + * * @param manager Entry point to AzureSphereManager. */ public static void devicesGet(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .devices() - .getWithResponse( - "MyResourceGroup1", - "MyCatalog1", - "MyProduct1", - "myDeviceGroup1", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - com.azure.core.util.Context.NONE); + manager.devices().getWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1", + "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + com.azure.core.util.Context.NONE); } } ``` @@ -809,21 +824,22 @@ public final class DevicesGetSamples { ### Devices_ListByDeviceGroup ```java -/** Samples for Devices ListByDeviceGroup. */ +/** + * Samples for Devices ListByDeviceGroup. + */ public final class DevicesListByDeviceGroupSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDevices.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDevices.json */ /** * Sample code: Devices_ListByDeviceGroup. - * + * * @param manager Entry point to AzureSphereManager. */ public static void devicesListByDeviceGroup(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .devices() - .listByDeviceGroup( - "MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1", com.azure.core.util.Context.NONE); + manager.devices().listByDeviceGroup("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1", + com.azure.core.util.Context.NONE); } } ``` @@ -833,28 +849,24 @@ public final class DevicesListByDeviceGroupSamples { ```java import com.azure.resourcemanager.sphere.models.Device; -/** Samples for Devices Update. */ +/** + * Samples for Devices Update. + */ public final class DevicesUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchDevice.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchDevice.json */ /** * Sample code: Devices_Update. - * + * * @param manager Entry point to AzureSphereManager. */ public static void devicesUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - Device resource = - manager - .devices() - .getWithResponse( - "MyResourceGroup1", - "MyCatalog1", - "MyProduct1", - "MyDeviceGroup1", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - com.azure.core.util.Context.NONE) - .getValue(); + Device resource = manager.devices().getWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", + "MyDeviceGroup1", + "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + com.azure.core.util.Context.NONE).getValue(); resource.update().apply(); } } @@ -863,23 +875,25 @@ public final class DevicesUpdateSamples { ### Images_CreateOrUpdate ```java -/** Samples for Images CreateOrUpdate. */ +import com.azure.resourcemanager.sphere.models.ImageProperties; + +/** + * Samples for Images CreateOrUpdate. + */ public final class ImagesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutImage.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutImage.json */ /** * Sample code: Image_CreateOrUpdate. - * + * * @param manager Entry point to AzureSphereManager. */ public static void imageCreateOrUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .images() - .define("default") + manager.images().define("00000000-0000-0000-0000-000000000000") .withExistingCatalog("MyResourceGroup1", "MyCatalog1") - .withImage("bXliYXNlNjRzdHJpbmc=") - .create(); + .withProperties(new ImageProperties().withImage("bXliYXNlNjRzdHJpbmc=")).create(); } } ``` @@ -887,18 +901,22 @@ public final class ImagesCreateOrUpdateSamples { ### Images_Delete ```java -/** Samples for Images Delete. */ +/** + * Samples for Images Delete. + */ public final class ImagesDeleteSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteImage.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteImage.json */ /** * Sample code: Images_Delete. - * + * * @param manager Entry point to AzureSphereManager. */ public static void imagesDelete(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager.images().delete("MyResourceGroup1", "MyCatalog1", "imageID", com.azure.core.util.Context.NONE); + manager.images().delete("MyResourceGroup1", "MyCatalog1", "00000000-0000-0000-0000-000000000000", + com.azure.core.util.Context.NONE); } } ``` @@ -906,20 +924,22 @@ public final class ImagesDeleteSamples { ### Images_Get ```java -/** Samples for Images Get. */ +/** + * Samples for Images Get. + */ public final class ImagesGetSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetImage.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetImage.json */ /** * Sample code: Images_Get. - * + * * @param manager Entry point to AzureSphereManager. */ public static void imagesGet(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .images() - .getWithResponse("MyResourceGroup1", "MyCatalog1", "myImageId", com.azure.core.util.Context.NONE); + manager.images().getWithResponse("MyResourceGroup1", "MyCatalog1", "00000000-0000-0000-0000-000000000000", + com.azure.core.util.Context.NONE); } } ``` @@ -927,20 +947,22 @@ public final class ImagesGetSamples { ### Images_ListByCatalog ```java -/** Samples for Images ListByCatalog. */ +/** + * Samples for Images ListByCatalog. + */ public final class ImagesListByCatalogSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetImages.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetImages.json */ /** * Sample code: Images_ListByCatalog. - * + * * @param manager Entry point to AzureSphereManager. */ public static void imagesListByCatalog(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .images() - .listByCatalog("MyResourceGroup1", "MyCatalog1", null, null, null, null, com.azure.core.util.Context.NONE); + manager.images().listByCatalog("MyResourceGroup1", "MyCatalog1", null, null, null, null, + com.azure.core.util.Context.NONE); } } ``` @@ -948,14 +970,17 @@ public final class ImagesListByCatalogSamples { ### Operations_List ```java -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetOperations.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetOperations.json */ /** * Sample code: Operations_List. - * + * * @param manager Entry point to AzureSphereManager. */ public static void operationsList(com.azure.resourcemanager.sphere.AzureSphereManager manager) { @@ -967,20 +992,23 @@ public final class OperationsListSamples { ### Products_CountDevices ```java -/** Samples for Products CountDevices. */ +/** + * Samples for Products CountDevices. + */ public final class ProductsCountDevicesSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesProduct.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostCountDevicesProduct. + * json */ /** * Sample code: Products_CountDevices. - * + * * @param manager Entry point to AzureSphereManager. */ public static void productsCountDevices(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .products() - .countDevicesWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", com.azure.core.util.Context.NONE); + manager.products().countDevicesWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", + com.azure.core.util.Context.NONE); } } ``` @@ -988,14 +1016,17 @@ public final class ProductsCountDevicesSamples { ### Products_CreateOrUpdate ```java -/** Samples for Products CreateOrUpdate. */ +/** + * Samples for Products CreateOrUpdate. + */ public final class ProductsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutProduct.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutProduct.json */ /** * Sample code: Products_CreateOrUpdate. - * + * * @param manager Entry point to AzureSphereManager. */ public static void productsCreateOrUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { @@ -1007,14 +1038,17 @@ public final class ProductsCreateOrUpdateSamples { ### Products_Delete ```java -/** Samples for Products Delete. */ +/** + * Samples for Products Delete. + */ public final class ProductsDeleteSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteProduct.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteProduct.json */ /** * Sample code: Products_Delete. - * + * * @param manager Entry point to AzureSphereManager. */ public static void productsDelete(com.azure.resourcemanager.sphere.AzureSphereManager manager) { @@ -1026,22 +1060,23 @@ public final class ProductsDeleteSamples { ### Products_GenerateDefaultDeviceGroups ```java -/** Samples for Products GenerateDefaultDeviceGroups. */ +/** + * Samples for Products GenerateDefaultDeviceGroups. + */ public final class ProductsGenerateDefaultDeviceGroupsSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostGenerateDefaultDeviceGroups.json + * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ + * PostGenerateDefaultDeviceGroups.json */ /** * Sample code: Products_GenerateDefaultDeviceGroups. - * + * * @param manager Entry point to AzureSphereManager. */ - public static void productsGenerateDefaultDeviceGroups( - com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .products() - .generateDefaultDeviceGroups( - "MyResourceGroup1", "MyCatalog1", "MyProduct1", com.azure.core.util.Context.NONE); + public static void + productsGenerateDefaultDeviceGroups(com.azure.resourcemanager.sphere.AzureSphereManager manager) { + manager.products().generateDefaultDeviceGroups("MyResourceGroup1", "MyCatalog1", "MyProduct1", + com.azure.core.util.Context.NONE); } } ``` @@ -1049,20 +1084,22 @@ public final class ProductsGenerateDefaultDeviceGroupsSamples { ### Products_Get ```java -/** Samples for Products Get. */ +/** + * Samples for Products Get. + */ public final class ProductsGetSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetProduct.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetProduct.json */ /** * Sample code: Products_Get. - * + * * @param manager Entry point to AzureSphereManager. */ public static void productsGet(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .products() - .getWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", com.azure.core.util.Context.NONE); + manager.products().getWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", + com.azure.core.util.Context.NONE); } } ``` @@ -1070,14 +1107,17 @@ public final class ProductsGetSamples { ### Products_ListByCatalog ```java -/** Samples for Products ListByCatalog. */ +/** + * Samples for Products ListByCatalog. + */ public final class ProductsListByCatalogSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetProducts.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetProducts.json */ /** * Sample code: Products_ListByCatalog. - * + * * @param manager Entry point to AzureSphereManager. */ public static void productsListByCatalog(com.azure.resourcemanager.sphere.AzureSphereManager manager) { @@ -1091,22 +1131,23 @@ public final class ProductsListByCatalogSamples { ```java import com.azure.resourcemanager.sphere.models.Product; -/** Samples for Products Update. */ +/** + * Samples for Products Update. + */ public final class ProductsUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchProduct.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchProduct.json */ /** * Sample code: Products_Update. - * + * * @param manager Entry point to AzureSphereManager. */ public static void productsUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - Product resource = - manager - .products() - .getWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", com.azure.core.util.Context.NONE) - .getValue(); + Product resource = manager.products() + .getWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", com.azure.core.util.Context.NONE) + .getValue(); resource.update().apply(); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/pom.xml b/sdk/sphere/azure-resourcemanager-sphere/pom.xml index 181c59053ef55..25fac3c84f3db 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/pom.xml +++ b/sdk/sphere/azure-resourcemanager-sphere/pom.xml @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-sphere - 1.0.0-beta.2 + 1.1.0-beta.1 jar Microsoft Azure SDK for AzureSphere Management - This package contains Microsoft Azure SDK for AzureSphere Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Sphere resource management API. Package tag package-2022-09-01-preview. + This package contains Microsoft Azure SDK for AzureSphere Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Sphere resource management API. Package tag package-2024-04-01. https://github.com/Azure/azure-sdk-for-java @@ -87,8 +87,6 @@ 4.11.0 test - - net.bytebuddy byte-buddy diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/AzureSphereManager.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/AzureSphereManager.java index 6b49b7f12dc7d..e13e0d5d2607b 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/AzureSphereManager.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/AzureSphereManager.java @@ -23,8 +23,8 @@ import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.sphere.fluent.AzureSphereManagementClient; -import com.azure.resourcemanager.sphere.implementation.AzureSphereManagementClientBuilder; +import com.azure.resourcemanager.sphere.fluent.AzureSphereMgmtClient; +import com.azure.resourcemanager.sphere.implementation.AzureSphereMgmtClientBuilder; import com.azure.resourcemanager.sphere.implementation.CatalogsImpl; import com.azure.resourcemanager.sphere.implementation.CertificatesImpl; import com.azure.resourcemanager.sphere.implementation.DeploymentsImpl; @@ -48,7 +48,10 @@ import java.util.Objects; import java.util.stream.Collectors; -/** Entry point to AzureSphereManager. Azure Sphere resource management API. */ +/** + * Entry point to AzureSphereManager. + * Azure Sphere resource management API. + */ public final class AzureSphereManager { private Operations operations; @@ -66,23 +69,19 @@ public final class AzureSphereManager { private Devices devices; - private final AzureSphereManagementClient clientObject; + private final AzureSphereMgmtClient clientObject; private AzureSphereManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new AzureSphereManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); + this.clientObject = new AzureSphereMgmtClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()).subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval).buildClient(); } /** * Creates an instance of AzureSphere service API entry point. - * + * * @param credential the credential to use. * @param profile the Azure profile for client. * @return the AzureSphere service API instance. @@ -95,7 +94,7 @@ public static AzureSphereManager authenticate(TokenCredential credential, AzureP /** * Creates an instance of AzureSphere service API entry point. - * + * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. * @return the AzureSphere service API instance. @@ -108,14 +107,16 @@ public static AzureSphereManager authenticate(HttpPipeline httpPipeline, AzurePr /** * Gets a Configurable instance that can be used to create AzureSphereManager with optional configuration. - * + * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { return new AzureSphereManager.Configurable(); } - /** The Configurable allowing configurations to be set. */ + /** + * The Configurable allowing configurations to be set. + */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); @@ -187,8 +188,8 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { /** * Sets the retry options for the HTTP pipeline retry policy. - * - *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + *

+ * 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. @@ -205,8 +206,8 @@ public Configurable withRetryOptions(RetryOptions retryOptions) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = - Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { throw LOGGER .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); @@ -226,21 +227,12 @@ public AzureSphereManager authenticate(TokenCredential credential, AzureProfile Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") - .append("-") - .append("com.azure.resourcemanager.sphere") - .append("/") - .append("1.0.0-beta.1"); + userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.sphere").append("/") + .append("1.0.0"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder - .append(" (") - .append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.name")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")) - .append("; auto-generated)"); + userAgentBuilder.append(" (").append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ").append(Configuration.getGlobalConfiguration().get("os.name")).append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")).append("; auto-generated)"); } else { userAgentBuilder.append(" (auto-generated)"); } @@ -259,38 +251,25 @@ public AzureSphereManager authenticate(TokenCredential credential, AzureProfile policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY).collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])).build(); return new AzureSphereManager(httpPipeline, profile, defaultPollInterval); } } /** * Gets the resource collection API of Operations. - * + * * @return Resource collection API of Operations. */ public Operations operations() { @@ -302,7 +281,7 @@ public Operations operations() { /** * Gets the resource collection API of Catalogs. It manages Catalog. - * + * * @return Resource collection API of Catalogs. */ public Catalogs catalogs() { @@ -314,7 +293,7 @@ public Catalogs catalogs() { /** * Gets the resource collection API of Certificates. - * + * * @return Resource collection API of Certificates. */ public Certificates certificates() { @@ -326,7 +305,7 @@ public Certificates certificates() { /** * Gets the resource collection API of Images. It manages Image. - * + * * @return Resource collection API of Images. */ public Images images() { @@ -338,7 +317,7 @@ public Images images() { /** * Gets the resource collection API of Products. It manages Product. - * + * * @return Resource collection API of Products. */ public Products products() { @@ -350,7 +329,7 @@ public Products products() { /** * Gets the resource collection API of DeviceGroups. It manages DeviceGroup. - * + * * @return Resource collection API of DeviceGroups. */ public DeviceGroups deviceGroups() { @@ -362,7 +341,7 @@ public DeviceGroups deviceGroups() { /** * Gets the resource collection API of Deployments. It manages Deployment. - * + * * @return Resource collection API of Deployments. */ public Deployments deployments() { @@ -374,7 +353,7 @@ public Deployments deployments() { /** * Gets the resource collection API of Devices. It manages Device. - * + * * @return Resource collection API of Devices. */ public Devices devices() { @@ -385,10 +364,12 @@ public Devices devices() { } /** - * @return Wrapped service client AzureSphereManagementClient providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API. + * Gets wrapped service client AzureSphereMgmtClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client AzureSphereMgmtClient. */ - public AzureSphereManagementClient serviceClient() { + public AzureSphereMgmtClient serviceClient() { return this.clientObject; } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/AzureSphereManagementClient.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/AzureSphereMgmtClient.java similarity index 91% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/AzureSphereManagementClient.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/AzureSphereMgmtClient.java index 82f217261953a..5a4f1d01f66cf 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/AzureSphereManagementClient.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/AzureSphereMgmtClient.java @@ -7,95 +7,97 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for AzureSphereManagementClient class. */ -public interface AzureSphereManagementClient { +/** + * The interface for AzureSphereMgmtClient class. + */ +public interface AzureSphereMgmtClient { /** * 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 CatalogsClient object to access its operations. - * + * * @return the CatalogsClient object. */ CatalogsClient getCatalogs(); /** * Gets the CertificatesClient object to access its operations. - * + * * @return the CertificatesClient object. */ CertificatesClient getCertificates(); /** * Gets the ImagesClient object to access its operations. - * + * * @return the ImagesClient object. */ ImagesClient getImages(); /** * Gets the ProductsClient object to access its operations. - * + * * @return the ProductsClient object. */ ProductsClient getProducts(); /** * Gets the DeviceGroupsClient object to access its operations. - * + * * @return the DeviceGroupsClient object. */ DeviceGroupsClient getDeviceGroups(); /** * Gets the DeploymentsClient object to access its operations. - * + * * @return the DeploymentsClient object. */ DeploymentsClient getDeployments(); /** * Gets the DevicesClient object to access its operations. - * + * * @return the DevicesClient object. */ DevicesClient getDevices(); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/CatalogsClient.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/CatalogsClient.java index b06050790d6c4..d66f6cffc0bce 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/CatalogsClient.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/CatalogsClient.java @@ -12,19 +12,22 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.sphere.fluent.models.CatalogInner; -import com.azure.resourcemanager.sphere.fluent.models.CountDeviceResponseInner; +import com.azure.resourcemanager.sphere.fluent.models.CountDevicesResponseInner; import com.azure.resourcemanager.sphere.fluent.models.DeploymentInner; import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner; import com.azure.resourcemanager.sphere.fluent.models.DeviceInner; import com.azure.resourcemanager.sphere.fluent.models.DeviceInsightInner; +import com.azure.resourcemanager.sphere.fluent.models.ImageInner; import com.azure.resourcemanager.sphere.models.CatalogUpdate; import com.azure.resourcemanager.sphere.models.ListDeviceGroupsRequest; -/** An instance of this class provides access to all the operations defined in CatalogsClient. */ +/** + * An instance of this class provides access to all the operations defined in CatalogsClient. + */ public interface CatalogsClient { /** * List Catalog resources by subscription ID. - * + * * @throws com.azure.core.management.exception.ManagementException thrown 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 a Catalog list operation as paginated response with {@link PagedIterable}. @@ -34,7 +37,7 @@ public interface CatalogsClient { /** * List Catalog resources by subscription 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. @@ -46,7 +49,7 @@ public interface CatalogsClient { /** * List Catalog resources by 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. @@ -58,7 +61,7 @@ public interface CatalogsClient { /** * List Catalog resources by 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. @@ -71,7 +74,7 @@ public interface CatalogsClient { /** * Get a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -81,12 +84,12 @@ public interface CatalogsClient { * @return a Catalog along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String catalogName, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String catalogName, + Context context); /** * Get a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -99,7 +102,7 @@ Response getByResourceGroupWithResponse( /** * Create a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param resource Resource create parameters. @@ -109,12 +112,12 @@ Response getByResourceGroupWithResponse( * @return the {@link SyncPoller} for polling of an Azure Sphere catalog. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CatalogInner> beginCreateOrUpdate( - String resourceGroupName, String catalogName, CatalogInner resource); + SyncPoller, CatalogInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, + CatalogInner resource); /** * Create a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param resource Resource create parameters. @@ -125,12 +128,12 @@ SyncPoller, CatalogInner> beginCreateOrUpdate( * @return the {@link SyncPoller} for polling of an Azure Sphere catalog. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CatalogInner> beginCreateOrUpdate( - String resourceGroupName, String catalogName, CatalogInner resource, Context context); + SyncPoller, CatalogInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, + CatalogInner resource, Context context); /** * Create a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param resource Resource create parameters. @@ -144,7 +147,7 @@ SyncPoller, CatalogInner> beginCreateOrUpdate( /** * Create a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param resource Resource create parameters. @@ -159,7 +162,7 @@ SyncPoller, CatalogInner> beginCreateOrUpdate( /** * Update a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param properties The resource properties to be updated. @@ -170,12 +173,12 @@ SyncPoller, CatalogInner> beginCreateOrUpdate( * @return an Azure Sphere catalog along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String catalogName, CatalogUpdate properties, Context context); + Response updateWithResponse(String resourceGroupName, String catalogName, CatalogUpdate properties, + Context context); /** * Update a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param properties The resource properties to be updated. @@ -189,7 +192,7 @@ Response updateWithResponse( /** * Delete a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -202,7 +205,7 @@ Response updateWithResponse( /** * Delete a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -216,7 +219,7 @@ Response updateWithResponse( /** * Delete a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -228,7 +231,7 @@ Response updateWithResponse( /** * Delete a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -241,7 +244,7 @@ Response updateWithResponse( /** * Counts devices in catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -251,12 +254,12 @@ Response updateWithResponse( * @return response to the action call for count devices in a catalog along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response countDevicesWithResponse( - String resourceGroupName, String catalogName, Context context); + Response countDevicesWithResponse(String resourceGroupName, String catalogName, + Context context); /** * Counts devices in catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -265,11 +268,11 @@ Response countDevicesWithResponse( * @return response to the action call for count devices in a catalog. */ @ServiceMethod(returns = ReturnType.SINGLE) - CountDeviceResponseInner countDevices(String resourceGroupName, String catalogName); + CountDevicesResponseInner countDevices(String resourceGroupName, String catalogName); /** * Lists deployments for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -282,7 +285,7 @@ Response countDevicesWithResponse( /** * Lists deployments for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -296,18 +299,12 @@ Response countDevicesWithResponse( * @return the response of a Deployment list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDeployments( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context); + PagedIterable listDeployments(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context); /** * List the device groups for the catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param listDeviceGroupsRequest List device groups for catalog. @@ -317,12 +314,12 @@ PagedIterable listDeployments( * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDeviceGroups( - String resourceGroupName, String catalogName, ListDeviceGroupsRequest listDeviceGroupsRequest); + PagedIterable listDeviceGroups(String resourceGroupName, String catalogName, + ListDeviceGroupsRequest listDeviceGroupsRequest); /** * List the device groups for the catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param listDeviceGroupsRequest List device groups for catalog. @@ -337,19 +334,13 @@ PagedIterable listDeviceGroups( * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDeviceGroups( - String resourceGroupName, - String catalogName, - ListDeviceGroupsRequest listDeviceGroupsRequest, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, + PagedIterable listDeviceGroups(String resourceGroupName, String catalogName, + ListDeviceGroupsRequest listDeviceGroupsRequest, String filter, Integer top, Integer skip, Integer maxpagesize, Context context); /** * Lists device insights for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -362,7 +353,7 @@ PagedIterable listDeviceGroups( /** * Lists device insights for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -376,18 +367,12 @@ PagedIterable listDeviceGroups( * @return paged collection of DeviceInsight items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDeviceInsights( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context); + PagedIterable listDeviceInsights(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context); /** * Lists devices for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -400,7 +385,7 @@ PagedIterable listDeviceInsights( /** * Lists devices for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -414,12 +399,64 @@ PagedIterable listDeviceInsights( * @return the response of a Device list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listDevices( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context); + PagedIterable listDevices(String resourceGroupName, String catalogName, String filter, Integer top, + Integer skip, Integer maxpagesize, Context context); + + /** + * Creates an image. Use this action when the image ID is unknown. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param uploadImageRequest Image upload 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUploadImage(String resourceGroupName, String catalogName, + ImageInner uploadImageRequest); + + /** + * Creates an image. Use this action when the image ID is unknown. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param uploadImageRequest Image upload 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginUploadImage(String resourceGroupName, String catalogName, + ImageInner uploadImageRequest, Context context); + + /** + * Creates an image. Use this action when the image ID is unknown. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param uploadImageRequest Image upload 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void uploadImage(String resourceGroupName, String catalogName, ImageInner uploadImageRequest); + + /** + * Creates an image. Use this action when the image ID is unknown. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param uploadImageRequest Image upload 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void uploadImage(String resourceGroupName, String catalogName, ImageInner uploadImageRequest, Context context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/CertificatesClient.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/CertificatesClient.java index a25275cddf218..b76a551fcd5e8 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/CertificatesClient.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/CertificatesClient.java @@ -14,11 +14,13 @@ import com.azure.resourcemanager.sphere.fluent.models.ProofOfPossessionNonceResponseInner; import com.azure.resourcemanager.sphere.models.ProofOfPossessionNonceRequest; -/** An instance of this class provides access to all the operations defined in CertificatesClient. */ +/** + * An instance of this class provides access to all the operations defined in CertificatesClient. + */ public interface CertificatesClient { /** * List Certificate resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -31,7 +33,7 @@ public interface CertificatesClient { /** * List Certificate resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -45,18 +47,12 @@ public interface CertificatesClient { * @return the response of a Certificate list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCatalog( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context); + PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context); /** * Get a Certificate. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -67,12 +63,12 @@ PagedIterable listByCatalog( * @return a Certificate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String catalogName, String serialNumber, Context context); + Response getWithResponse(String resourceGroupName, String catalogName, String serialNumber, + Context context); /** * Get a Certificate. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -86,7 +82,7 @@ Response getWithResponse( /** * Retrieves cert chain. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -97,12 +93,12 @@ Response getWithResponse( * @return the certificate chain response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response retrieveCertChainWithResponse( - String resourceGroupName, String catalogName, String serialNumber, Context context); + Response retrieveCertChainWithResponse(String resourceGroupName, String catalogName, + String serialNumber, Context context); /** * Retrieves cert chain. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -116,7 +112,7 @@ Response retrieveCertChainWithResponse( /** * Gets the proof of possession nonce. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -128,16 +124,13 @@ Response retrieveCertChainWithResponse( * @return the proof of possession nonce along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response retrieveProofOfPossessionNonceWithResponse( - String resourceGroupName, - String catalogName, - String serialNumber, - ProofOfPossessionNonceRequest proofOfPossessionNonceRequest, + Response retrieveProofOfPossessionNonceWithResponse(String resourceGroupName, + String catalogName, String serialNumber, ProofOfPossessionNonceRequest proofOfPossessionNonceRequest, Context context); /** * Gets the proof of possession nonce. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -148,9 +141,6 @@ Response retrieveProofOfPossessionNonceWith * @return the proof of possession nonce. */ @ServiceMethod(returns = ReturnType.SINGLE) - ProofOfPossessionNonceResponseInner retrieveProofOfPossessionNonce( - String resourceGroupName, - String catalogName, - String serialNumber, - ProofOfPossessionNonceRequest proofOfPossessionNonceRequest); + ProofOfPossessionNonceResponseInner retrieveProofOfPossessionNonce(String resourceGroupName, String catalogName, + String serialNumber, ProofOfPossessionNonceRequest proofOfPossessionNonceRequest); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DeploymentsClient.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DeploymentsClient.java index 0d59f94edfa18..c02caa703a712 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DeploymentsClient.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DeploymentsClient.java @@ -13,12 +13,14 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.sphere.fluent.models.DeploymentInner; -/** An instance of this class provides access to all the operations defined in DeploymentsClient. */ +/** + * An instance of this class provides access to all the operations defined in DeploymentsClient. + */ public interface DeploymentsClient { /** * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be * used for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -29,13 +31,13 @@ public interface DeploymentsClient { * @return the response of a Deployment list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDeviceGroup( - String resourceGroupName, String catalogName, String productName, String deviceGroupName); + PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName); /** * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be * used for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -51,27 +53,19 @@ PagedIterable listByDeviceGroup( * @return the response of a Deployment list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDeviceGroup( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context); + PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context); /** * Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device * group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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. @@ -79,47 +73,38 @@ PagedIterable listByDeviceGroup( * @return a Deployment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - Context context); + Response getWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName, Context context); /** * Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device * group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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 Deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentInner get( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, + DeploymentInner get(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deploymentName); /** * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device group. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -127,24 +112,20 @@ DeploymentInner get( * @return the {@link SyncPoller} for polling of an deployment resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentInner> beginCreateOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, + SyncPoller, DeploymentInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deploymentName, DeploymentInner resource); /** * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device group. * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -153,25 +134,20 @@ SyncPoller, DeploymentInner> beginCreateOrUpdate( * @return the {@link SyncPoller} for polling of an deployment resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeploymentInner> beginCreateOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - DeploymentInner resource, + SyncPoller, DeploymentInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deploymentName, DeploymentInner resource, Context context); /** * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device group. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -179,24 +155,19 @@ SyncPoller, DeploymentInner> beginCreateOrUpdate( * @return an deployment resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentInner createOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - DeploymentInner resource); + DeploymentInner createOrUpdate(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName, DeploymentInner resource); /** * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device group. * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -205,48 +176,38 @@ DeploymentInner createOrUpdate( * @return an deployment resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeploymentInner createOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - DeploymentInner resource, - Context context); + DeploymentInner createOrUpdate(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName, DeploymentInner resource, Context context); /** * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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 {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName); + SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName); /** * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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. @@ -254,57 +215,43 @@ SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName, Context context); /** * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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 catalogName, - String productName, - String deviceGroupName, + void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deploymentName); /** * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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 catalogName, - String productName, - String deviceGroupName, - String deploymentName, - Context context); + void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deploymentName, Context context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DeviceGroupsClient.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DeviceGroupsClient.java index 4e210133bb5c0..5de380b9aaf79 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DeviceGroupsClient.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DeviceGroupsClient.java @@ -11,17 +11,19 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.sphere.fluent.models.CountDeviceResponseInner; +import com.azure.resourcemanager.sphere.fluent.models.CountDevicesResponseInner; import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner; import com.azure.resourcemanager.sphere.models.ClaimDevicesRequest; import com.azure.resourcemanager.sphere.models.DeviceGroupUpdate; -/** An instance of this class provides access to all the operations defined in DeviceGroupsClient. */ +/** + * An instance of this class provides access to all the operations defined in DeviceGroupsClient. + */ public interface DeviceGroupsClient { /** * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used * for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -36,7 +38,7 @@ public interface DeviceGroupsClient { /** * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used * for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -51,20 +53,13 @@ public interface DeviceGroupsClient { * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByProduct( - String resourceGroupName, - String catalogName, - String productName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context); + PagedIterable listByProduct(String resourceGroupName, String catalogName, String productName, + String filter, Integer top, Integer skip, Integer maxpagesize, Context context); /** * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -76,13 +71,13 @@ PagedIterable listByProduct( * @return a DeviceGroup along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context); + Response getWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, Context context); /** * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -98,7 +93,7 @@ Response getWithResponse( /** * Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -110,17 +105,13 @@ Response getWithResponse( * @return the {@link SyncPoller} for polling of an device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeviceGroupInner> beginCreateOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupInner resource); + SyncPoller, DeviceGroupInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, DeviceGroupInner resource); /** * Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -133,18 +124,13 @@ SyncPoller, DeviceGroupInner> beginCreateOrUpdate( * @return the {@link SyncPoller} for polling of an device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeviceGroupInner> beginCreateOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupInner resource, - Context context); + SyncPoller, DeviceGroupInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, DeviceGroupInner resource, Context context); /** * Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -156,17 +142,13 @@ SyncPoller, DeviceGroupInner> beginCreateOrUpdate( * @return an device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeviceGroupInner createOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupInner resource); + DeviceGroupInner createOrUpdate(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, DeviceGroupInner resource); /** * Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -179,18 +161,13 @@ DeviceGroupInner createOrUpdate( * @return an device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeviceGroupInner createOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupInner resource, - Context context); + DeviceGroupInner createOrUpdate(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, DeviceGroupInner resource, Context context); /** * Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -202,17 +179,13 @@ DeviceGroupInner createOrUpdate( * @return the {@link SyncPoller} for polling of an device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeviceGroupInner> beginUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupUpdate properties); + SyncPoller, DeviceGroupInner> beginUpdate(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, DeviceGroupUpdate properties); /** * Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -225,18 +198,13 @@ SyncPoller, DeviceGroupInner> beginUpdate( * @return the {@link SyncPoller} for polling of an device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeviceGroupInner> beginUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupUpdate properties, - Context context); + SyncPoller, DeviceGroupInner> beginUpdate(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, DeviceGroupUpdate properties, Context context); /** * Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -248,17 +216,13 @@ SyncPoller, DeviceGroupInner> beginUpdate( * @return an device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeviceGroupInner update( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, + DeviceGroupInner update(String resourceGroupName, String catalogName, String productName, String deviceGroupName, DeviceGroupUpdate properties); /** * Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -271,18 +235,13 @@ DeviceGroupInner update( * @return an device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeviceGroupInner update( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupUpdate properties, - Context context); + DeviceGroupInner update(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + DeviceGroupUpdate properties, Context context); /** * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -293,13 +252,13 @@ DeviceGroupInner update( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String catalogName, String productName, String deviceGroupName); + SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, String productName, + String deviceGroupName); /** * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -311,13 +270,13 @@ SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, Context context); /** * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -332,7 +291,7 @@ SyncPoller, Void> beginDelete( /** * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -343,13 +302,13 @@ SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context); + void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + Context context); /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk * claiming devices to a catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -361,17 +320,13 @@ void delete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginClaimDevices( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - ClaimDevicesRequest claimDevicesRequest); + SyncPoller, Void> beginClaimDevices(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest); /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk * claiming devices to a catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -384,18 +339,13 @@ SyncPoller, Void> beginClaimDevices( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginClaimDevices( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - ClaimDevicesRequest claimDevicesRequest, - Context context); + SyncPoller, Void> beginClaimDevices(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest, Context context); /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk * claiming devices to a catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -406,17 +356,13 @@ SyncPoller, Void> beginClaimDevices( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void claimDevices( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, + void claimDevices(String resourceGroupName, String catalogName, String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest); /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk * claiming devices to a catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -428,18 +374,13 @@ void claimDevices( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void claimDevices( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - ClaimDevicesRequest claimDevicesRequest, - Context context); + void claimDevices(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + ClaimDevicesRequest claimDevicesRequest, Context context); /** * Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for * product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -451,13 +392,13 @@ void claimDevices( * @return response to the action call for count devices in a catalog along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response countDevicesWithResponse( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context); + Response countDevicesWithResponse(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, Context context); /** * Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for * product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -468,6 +409,6 @@ Response countDevicesWithResponse( * @return response to the action call for count devices in a catalog. */ @ServiceMethod(returns = ReturnType.SINGLE) - CountDeviceResponseInner countDevices( - String resourceGroupName, String catalogName, String productName, String deviceGroupName); + CountDevicesResponseInner countDevices(String resourceGroupName, String catalogName, String productName, + String deviceGroupName); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DevicesClient.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DevicesClient.java index b053aa5cadace..9e6322247bf44 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DevicesClient.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/DevicesClient.java @@ -16,12 +16,14 @@ import com.azure.resourcemanager.sphere.models.DeviceUpdate; import com.azure.resourcemanager.sphere.models.GenerateCapabilityImageRequest; -/** An instance of this class provides access to all the operations defined in DevicesClient. */ +/** + * An instance of this class provides access to all the operations defined in DevicesClient. + */ public interface DevicesClient { /** * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used * for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -32,13 +34,13 @@ public interface DevicesClient { * @return the response of a Device list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDeviceGroup( - String resourceGroupName, String catalogName, String productName, String deviceGroupName); + PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName); /** * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used * for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -50,13 +52,13 @@ PagedIterable listByDeviceGroup( * @return the response of a Device list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDeviceGroup( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context); + PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, Context context); /** * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not * belong to a device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -69,18 +71,13 @@ PagedIterable listByDeviceGroup( * @return a Device along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - Context context); + Response getWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, Context context); /** * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not * belong to a device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -92,13 +89,13 @@ Response getWithResponse( * @return a Device. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeviceInner get( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName); + DeviceInner get(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName); /** * Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the * catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -111,18 +108,13 @@ DeviceInner get( * @return the {@link SyncPoller} for polling of an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeviceInner> beginCreateOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceInner resource); + SyncPoller, DeviceInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, DeviceInner resource); /** * Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the * catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -136,19 +128,13 @@ SyncPoller, DeviceInner> beginCreateOrUpdate( * @return the {@link SyncPoller} for polling of an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeviceInner> beginCreateOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceInner resource, - Context context); + SyncPoller, DeviceInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, DeviceInner resource, Context context); /** * Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the * catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -161,18 +147,13 @@ SyncPoller, DeviceInner> beginCreateOrUpdate( * @return an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeviceInner createOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceInner resource); + DeviceInner createOrUpdate(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName, DeviceInner resource); /** * Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the * catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -186,19 +167,13 @@ DeviceInner createOrUpdate( * @return an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeviceInner createOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceInner resource, - Context context); + DeviceInner createOrUpdate(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName, DeviceInner resource, Context context); /** * Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the * catalog level. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -211,18 +186,13 @@ DeviceInner createOrUpdate( * @return the {@link SyncPoller} for polling of an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeviceInner> beginUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceUpdate properties); + SyncPoller, DeviceInner> beginUpdate(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, DeviceUpdate properties); /** * Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the * catalog level. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -236,19 +206,13 @@ SyncPoller, DeviceInner> beginUpdate( * @return the {@link SyncPoller} for polling of an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DeviceInner> beginUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceUpdate properties, - Context context); + SyncPoller, DeviceInner> beginUpdate(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, DeviceUpdate properties, Context context); /** * Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the * catalog level. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -261,18 +225,13 @@ SyncPoller, DeviceInner> beginUpdate( * @return an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeviceInner update( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceUpdate properties); + DeviceInner update(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName, DeviceUpdate properties); /** * Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the * catalog level. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -286,18 +245,12 @@ DeviceInner update( * @return an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - DeviceInner update( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceUpdate properties, - Context context); + DeviceInner update(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName, DeviceUpdate properties, Context context); /** * Delete a Device. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -309,12 +262,12 @@ DeviceInner update( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName); + SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName); /** * Delete a Device. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -327,17 +280,12 @@ SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, Context context); /** * Delete a Device. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -348,12 +296,12 @@ SyncPoller, Void> beginDelete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName); + void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName); /** * Delete a Device. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -365,18 +313,13 @@ void delete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - Context context); + void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName, Context context); /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product * names to generate the image for a device that does not belong to a specific device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -390,18 +333,13 @@ void delete( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SignedCapabilityImageResponseInner> - beginGenerateCapabilityImage( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - GenerateCapabilityImageRequest generateDeviceCapabilityRequest); + beginGenerateCapabilityImage(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest); /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product * names to generate the image for a device that does not belong to a specific device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -416,19 +354,14 @@ void delete( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SignedCapabilityImageResponseInner> - beginGenerateCapabilityImage( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - GenerateCapabilityImageRequest generateDeviceCapabilityRequest, + beginGenerateCapabilityImage(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest, Context context); /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product * names to generate the image for a device that does not belong to a specific device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -441,18 +374,14 @@ void delete( * @return signed device capability image response. */ @ServiceMethod(returns = ReturnType.SINGLE) - SignedCapabilityImageResponseInner generateCapabilityImage( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, + SignedCapabilityImageResponseInner generateCapabilityImage(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest); /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product * names to generate the image for a device that does not belong to a specific device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -466,12 +395,7 @@ SignedCapabilityImageResponseInner generateCapabilityImage( * @return signed device capability image response. */ @ServiceMethod(returns = ReturnType.SINGLE) - SignedCapabilityImageResponseInner generateCapabilityImage( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - GenerateCapabilityImageRequest generateDeviceCapabilityRequest, - Context context); + SignedCapabilityImageResponseInner generateCapabilityImage(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, + GenerateCapabilityImageRequest generateDeviceCapabilityRequest, Context context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/ImagesClient.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/ImagesClient.java index 205ceca662eb9..de16245b13d1f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/ImagesClient.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/ImagesClient.java @@ -13,11 +13,13 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.sphere.fluent.models.ImageInner; -/** An instance of this class provides access to all the operations defined in ImagesClient. */ +/** + * An instance of this class provides access to all the operations defined in ImagesClient. + */ public interface ImagesClient { /** * List Image resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -30,7 +32,7 @@ public interface ImagesClient { /** * List Image resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -44,21 +46,15 @@ public interface ImagesClient { * @return the response of a Image list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByCatalog( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context); + PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, Integer top, + Integer skip, Integer maxpagesize, Context context); /** * Get a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -66,15 +62,15 @@ PagedIterable listByCatalog( * @return a Image along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String catalogName, String imageName, Context context); + Response getWithResponse(String resourceGroupName, String catalogName, String imageName, + Context context); /** * Get a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -85,10 +81,10 @@ Response getWithResponse( /** * Create a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the API. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -96,15 +92,15 @@ Response getWithResponse( * @return the {@link SyncPoller} for polling of an image resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ImageInner> beginCreateOrUpdate( - String resourceGroupName, String catalogName, String imageName, ImageInner resource); + SyncPoller, ImageInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, + String imageName, ImageInner resource); /** * Create a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the API. * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -113,15 +109,15 @@ SyncPoller, ImageInner> beginCreateOrUpdate( * @return the {@link SyncPoller} for polling of an image resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ImageInner> beginCreateOrUpdate( - String resourceGroupName, String catalogName, String imageName, ImageInner resource, Context context); + SyncPoller, ImageInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, + String imageName, ImageInner resource, Context context); /** * Create a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the API. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -133,10 +129,10 @@ SyncPoller, ImageInner> beginCreateOrUpdate( /** * Create a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the API. * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -145,15 +141,15 @@ SyncPoller, ImageInner> beginCreateOrUpdate( * @return an image resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - ImageInner createOrUpdate( - String resourceGroupName, String catalogName, String imageName, ImageInner resource, Context context); + ImageInner createOrUpdate(String resourceGroupName, String catalogName, String imageName, ImageInner resource, + Context context); /** * Delete a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -164,10 +160,10 @@ ImageInner createOrUpdate( /** * Delete a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -175,15 +171,15 @@ ImageInner createOrUpdate( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String catalogName, String imageName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, String imageName, + Context context); /** * Delete a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -193,10 +189,10 @@ SyncPoller, Void> beginDelete( /** * Delete a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/OperationsClient.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/OperationsClient.java index 628bd10d47fca..fa904d1972694 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/OperationsClient.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/OperationsClient.java @@ -10,28 +10,30 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.sphere.fluent.models.OperationInner; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public interface OperationsClient { /** * List the operations for the 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * List the operations for the 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/ProductsClient.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/ProductsClient.java index bcf5c9ad48259..684c9df9b38b4 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/ProductsClient.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/ProductsClient.java @@ -11,16 +11,18 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.sphere.fluent.models.CountDeviceResponseInner; +import com.azure.resourcemanager.sphere.fluent.models.CountDevicesResponseInner; import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner; import com.azure.resourcemanager.sphere.fluent.models.ProductInner; import com.azure.resourcemanager.sphere.models.ProductUpdate; -/** An instance of this class provides access to all the operations defined in ProductsClient. */ +/** + * An instance of this class provides access to all the operations defined in ProductsClient. + */ public interface ProductsClient { /** * List Product resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -33,7 +35,7 @@ public interface ProductsClient { /** * List Product resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -47,7 +49,7 @@ public interface ProductsClient { /** * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -58,12 +60,12 @@ public interface ProductsClient { * @return a Product along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String catalogName, String productName, Context context); + Response getWithResponse(String resourceGroupName, String catalogName, String productName, + Context context); /** * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -77,7 +79,7 @@ Response getWithResponse( /** * Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -88,12 +90,12 @@ Response getWithResponse( * @return the {@link SyncPoller} for polling of an product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProductInner> beginCreateOrUpdate( - String resourceGroupName, String catalogName, String productName, ProductInner resource); + SyncPoller, ProductInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, + String productName, ProductInner resource); /** * Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -105,12 +107,12 @@ SyncPoller, ProductInner> beginCreateOrUpdate( * @return the {@link SyncPoller} for polling of an product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProductInner> beginCreateOrUpdate( - String resourceGroupName, String catalogName, String productName, ProductInner resource, Context context); + SyncPoller, ProductInner> beginCreateOrUpdate(String resourceGroupName, String catalogName, + String productName, ProductInner resource, Context context); /** * Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -121,12 +123,12 @@ SyncPoller, ProductInner> beginCreateOrUpdate( * @return an product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - ProductInner createOrUpdate( - String resourceGroupName, String catalogName, String productName, ProductInner resource); + ProductInner createOrUpdate(String resourceGroupName, String catalogName, String productName, + ProductInner resource); /** * Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -138,12 +140,12 @@ ProductInner createOrUpdate( * @return an product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - ProductInner createOrUpdate( - String resourceGroupName, String catalogName, String productName, ProductInner resource, Context context); + ProductInner createOrUpdate(String resourceGroupName, String catalogName, String productName, ProductInner resource, + Context context); /** * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -154,12 +156,12 @@ ProductInner createOrUpdate( * @return the {@link SyncPoller} for polling of an product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProductInner> beginUpdate( - String resourceGroupName, String catalogName, String productName, ProductUpdate properties); + SyncPoller, ProductInner> beginUpdate(String resourceGroupName, String catalogName, + String productName, ProductUpdate properties); /** * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -171,12 +173,12 @@ SyncPoller, ProductInner> beginUpdate( * @return the {@link SyncPoller} for polling of an product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ProductInner> beginUpdate( - String resourceGroupName, String catalogName, String productName, ProductUpdate properties, Context context); + SyncPoller, ProductInner> beginUpdate(String resourceGroupName, String catalogName, + String productName, ProductUpdate properties, Context context); /** * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -191,7 +193,7 @@ SyncPoller, ProductInner> beginUpdate( /** * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -203,12 +205,12 @@ SyncPoller, ProductInner> beginUpdate( * @return an product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - ProductInner update( - String resourceGroupName, String catalogName, String productName, ProductUpdate properties, Context context); + ProductInner update(String resourceGroupName, String catalogName, String productName, ProductUpdate properties, + Context context); /** * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -222,7 +224,7 @@ ProductInner update( /** * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -233,12 +235,12 @@ ProductInner update( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String catalogName, String productName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, String productName, + Context context); /** * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -251,7 +253,7 @@ SyncPoller, Void> beginDelete( /** * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -266,7 +268,7 @@ SyncPoller, Void> beginDelete( /** * Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product * name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -277,13 +279,13 @@ SyncPoller, Void> beginDelete( * @return response to the action call for count devices in a catalog along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response countDevicesWithResponse( - String resourceGroupName, String catalogName, String productName, Context context); + Response countDevicesWithResponse(String resourceGroupName, String catalogName, + String productName, Context context); /** * Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product * name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -293,12 +295,12 @@ Response countDevicesWithResponse( * @return response to the action call for count devices in a catalog. */ @ServiceMethod(returns = ReturnType.SINGLE) - CountDeviceResponseInner countDevices(String resourceGroupName, String catalogName, String productName); + CountDevicesResponseInner countDevices(String resourceGroupName, String catalogName, String productName); /** * Generates default device groups for the product. '.default' and '.unassigned' are system defined values and * cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -308,13 +310,13 @@ Response countDevicesWithResponse( * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable generateDefaultDeviceGroups( - String resourceGroupName, String catalogName, String productName); + PagedIterable generateDefaultDeviceGroups(String resourceGroupName, String catalogName, + String productName); /** * Generates default device groups for the product. '.default' and '.unassigned' are system defined values and * cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -325,6 +327,6 @@ PagedIterable generateDefaultDeviceGroups( * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable generateDefaultDeviceGroups( - String resourceGroupName, String catalogName, String productName, Context context); + PagedIterable generateDefaultDeviceGroups(String resourceGroupName, String catalogName, + String productName, Context context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CatalogInner.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CatalogInner.java index a639e4b67f15c..ccedd272070fc 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CatalogInner.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CatalogInner.java @@ -7,18 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.azure.resourcemanager.sphere.models.ProvisioningState; +import com.azure.resourcemanager.sphere.models.CatalogProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** An Azure Sphere catalog. */ +/** + * An Azure Sphere catalog. + */ @Fluent public final class CatalogInner extends Resource { /* * The resource-specific properties for this resource. */ @JsonProperty(value = "properties") - private CatalogProperties innerProperties; + private CatalogProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -26,59 +28,67 @@ public final class CatalogInner extends Resource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of CatalogInner class. */ + /** + * Creates an instance of CatalogInner class. + */ public CatalogInner() { } /** - * Get the innerProperties property: The resource-specific properties for this resource. - * - * @return the innerProperties value. + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public CatalogProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the CatalogInner object itself. */ - private CatalogProperties innerProperties() { - return this.innerProperties; + public CatalogInner withProperties(CatalogProperties properties) { + this.properties = properties; + return this; } /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * + * * @return the systemData value. */ public SystemData systemData() { return this.systemData; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CatalogInner withLocation(String location) { super.withLocation(location); return this; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public CatalogInner withTags(Map tags) { super.withTags(tags); return this; } - /** - * Get the provisioningState property: The status of the last operation. - * - * @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 (properties() != null) { + properties().validate(); } } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CertificateChainResponseInner.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CertificateChainResponseInner.java index e5e299011709c..645198a6ac0db 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CertificateChainResponseInner.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CertificateChainResponseInner.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** The certificate chain response. */ +/** + * The certificate chain response. + */ @Immutable public final class CertificateChainResponseInner { /* @@ -16,13 +18,15 @@ public final class CertificateChainResponseInner { @JsonProperty(value = "certificateChain", access = JsonProperty.Access.WRITE_ONLY) private String certificateChain; - /** Creates an instance of CertificateChainResponseInner class. */ + /** + * Creates an instance of CertificateChainResponseInner class. + */ public CertificateChainResponseInner() { } /** * Get the certificateChain property: The certificate chain. - * + * * @return the certificateChain value. */ public String certificateChain() { @@ -31,7 +35,7 @@ public String certificateChain() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CertificateInner.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CertificateInner.java index 9f50de6cf610b..8cb6c15c3e929 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CertificateInner.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CertificateInner.java @@ -4,22 +4,22 @@ package com.azure.resourcemanager.sphere.fluent.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.azure.resourcemanager.sphere.models.CertificateStatus; -import com.azure.resourcemanager.sphere.models.ProvisioningState; +import com.azure.resourcemanager.sphere.models.CertificateProperties; import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -/** An certificate resource belonging to a catalog resource. */ -@Immutable +/** + * An certificate resource belonging to a catalog resource. + */ +@Fluent public final class CertificateInner extends ProxyResource { /* * The resource-specific properties for this resource. */ @JsonProperty(value = "properties") - private CertificateProperties innerProperties; + private CertificateProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -27,99 +27,49 @@ public final class CertificateInner extends ProxyResource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of CertificateInner class. */ - public CertificateInner() { - } - - /** - * Get the innerProperties property: The resource-specific properties for this resource. - * - * @return the innerProperties value. - */ - private CertificateProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the certificate property: The certificate as a UTF-8 encoded base 64 string. - * - * @return the certificate value. - */ - public String certificate() { - return this.innerProperties() == null ? null : this.innerProperties().certificate(); - } - - /** - * Get the status property: The certificate status. - * - * @return the status value. - */ - public CertificateStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the subject property: The certificate subject. - * - * @return the subject value. - */ - public String subject() { - return this.innerProperties() == null ? null : this.innerProperties().subject(); - } - /** - * Get the thumbprint property: The certificate thumbprint. - * - * @return the thumbprint value. + * Creates an instance of CertificateInner class. */ - public String thumbprint() { - return this.innerProperties() == null ? null : this.innerProperties().thumbprint(); + public CertificateInner() { } /** - * Get the expiryUtc property: The certificate expiry date. - * - * @return the expiryUtc value. + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - public OffsetDateTime expiryUtc() { - return this.innerProperties() == null ? null : this.innerProperties().expiryUtc(); + public CertificateProperties properties() { + return this.properties; } /** - * Get the notBeforeUtc property: The certificate not before date. - * - * @return the notBeforeUtc value. + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the CertificateInner object itself. */ - public OffsetDateTime notBeforeUtc() { - return this.innerProperties() == null ? null : this.innerProperties().notBeforeUtc(); + public CertificateInner withProperties(CertificateProperties properties) { + this.properties = properties; + return this; } /** - * Get the provisioningState property: The status of the last operation. - * - * @return the provisioningState value. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + public SystemData systemData() { + return this.systemData; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CountDeviceResponseInner.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CountDevicesResponseInner.java similarity index 62% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CountDeviceResponseInner.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CountDevicesResponseInner.java index 80c30909e9da4..04b3280e7b55e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CountDeviceResponseInner.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CountDevicesResponseInner.java @@ -7,23 +7,29 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.sphere.models.CountElementsResponse; -/** Response to the action call for count devices in a catalog. */ +/** + * Response to the action call for count devices in a catalog. + */ @Fluent -public final class CountDeviceResponseInner extends CountElementsResponse { - /** Creates an instance of CountDeviceResponseInner class. */ - public CountDeviceResponseInner() { +public final class CountDevicesResponseInner extends CountElementsResponse { + /** + * Creates an instance of CountDevicesResponseInner class. + */ + public CountDevicesResponseInner() { } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override - public CountDeviceResponseInner withValue(int value) { + public CountDevicesResponseInner withValue(int value) { super.withValue(value); return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeploymentInner.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeploymentInner.java index ed70be5ad59c9..cc20d198b15b6 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeploymentInner.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeploymentInner.java @@ -6,105 +6,70 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.sphere.models.ProvisioningState; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.sphere.models.DeploymentProperties; import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -/** An deployment resource belonging to a device group resource. */ +/** + * An deployment resource belonging to a device group resource. + */ @Fluent public final class DeploymentInner extends ProxyResource { /* * The resource-specific properties for this resource. */ @JsonProperty(value = "properties") - private DeploymentProperties innerProperties; + private DeploymentProperties properties; - /** Creates an instance of DeploymentInner class. */ - public DeploymentInner() { - } - - /** - * Get the innerProperties property: The resource-specific properties for this resource. - * - * @return the innerProperties value. + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private DeploymentProperties innerProperties() { - return this.innerProperties; - } + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /** - * Get the deploymentId property: Deployment ID. - * - * @return the deploymentId value. + * Creates an instance of DeploymentInner class. */ - public String deploymentId() { - return this.innerProperties() == null ? null : this.innerProperties().deploymentId(); - } - - /** - * Set the deploymentId property: Deployment ID. - * - * @param deploymentId the deploymentId value to set. - * @return the DeploymentInner object itself. - */ - public DeploymentInner withDeploymentId(String deploymentId) { - if (this.innerProperties() == null) { - this.innerProperties = new DeploymentProperties(); - } - this.innerProperties().withDeploymentId(deploymentId); - return this; + public DeploymentInner() { } /** - * Get the deployedImages property: Images deployed. - * - * @return the deployedImages value. + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - public List deployedImages() { - return this.innerProperties() == null ? null : this.innerProperties().deployedImages(); + public DeploymentProperties properties() { + return this.properties; } /** - * Set the deployedImages property: Images deployed. - * - * @param deployedImages the deployedImages value to set. + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. * @return the DeploymentInner object itself. */ - public DeploymentInner withDeployedImages(List deployedImages) { - if (this.innerProperties() == null) { - this.innerProperties = new DeploymentProperties(); - } - this.innerProperties().withDeployedImages(deployedImages); + public DeploymentInner withProperties(DeploymentProperties properties) { + this.properties = properties; return this; } /** - * Get the deploymentDateUtc property: Deployment date UTC. - * - * @return the deploymentDateUtc value. - */ - public OffsetDateTime deploymentDateUtc() { - return this.innerProperties() == null ? null : this.innerProperties().deploymentDateUtc(); - } - - /** - * Get the provisioningState property: The status of the last operation. - * - * @return the provisioningState value. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + public SystemData systemData() { + return this.systemData; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceGroupInner.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceGroupInner.java index c09d49d6624ea..5bce6f135bb14 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceGroupInner.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceGroupInner.java @@ -6,176 +6,70 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; -import com.azure.resourcemanager.sphere.models.OSFeedType; -import com.azure.resourcemanager.sphere.models.ProvisioningState; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import com.azure.resourcemanager.sphere.models.UpdatePolicy; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.sphere.models.DeviceGroupProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** An device group resource belonging to a product resource. */ +/** + * An device group resource belonging to a product resource. + */ @Fluent public final class DeviceGroupInner extends ProxyResource { /* * The resource-specific properties for this resource. */ @JsonProperty(value = "properties") - private DeviceGroupProperties innerProperties; + private DeviceGroupProperties properties; - /** Creates an instance of DeviceGroupInner class. */ - public DeviceGroupInner() { - } - - /** - * Get the innerProperties property: The resource-specific properties for this resource. - * - * @return the innerProperties value. - */ - private DeviceGroupProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the description property: Description of the device group. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Description of the device group. - * - * @param description the description value to set. - * @return the DeviceGroupInner object itself. - */ - public DeviceGroupInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceGroupProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the osFeedType property: Operating system feed type of the device group. - * - * @return the osFeedType value. - */ - public OSFeedType osFeedType() { - return this.innerProperties() == null ? null : this.innerProperties().osFeedType(); - } - - /** - * Set the osFeedType property: Operating system feed type of the device group. - * - * @param osFeedType the osFeedType value to set. - * @return the DeviceGroupInner object itself. - */ - public DeviceGroupInner withOsFeedType(OSFeedType osFeedType) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceGroupProperties(); - } - this.innerProperties().withOsFeedType(osFeedType); - return this; - } - - /** - * Get the updatePolicy property: Update policy of the device group. - * - * @return the updatePolicy value. - */ - public UpdatePolicy updatePolicy() { - return this.innerProperties() == null ? null : this.innerProperties().updatePolicy(); - } - - /** - * Set the updatePolicy property: Update policy of the device group. - * - * @param updatePolicy the updatePolicy value to set. - * @return the DeviceGroupInner object itself. - */ - public DeviceGroupInner withUpdatePolicy(UpdatePolicy updatePolicy) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceGroupProperties(); - } - this.innerProperties().withUpdatePolicy(updatePolicy); - return this; - } - - /** - * Get the allowCrashDumpsCollection property: Flag to define if the user allows for crash dump collection. - * - * @return the allowCrashDumpsCollection value. + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - public AllowCrashDumpCollection allowCrashDumpsCollection() { - return this.innerProperties() == null ? null : this.innerProperties().allowCrashDumpsCollection(); - } + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /** - * Set the allowCrashDumpsCollection property: Flag to define if the user allows for crash dump collection. - * - * @param allowCrashDumpsCollection the allowCrashDumpsCollection value to set. - * @return the DeviceGroupInner object itself. + * Creates an instance of DeviceGroupInner class. */ - public DeviceGroupInner withAllowCrashDumpsCollection(AllowCrashDumpCollection allowCrashDumpsCollection) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceGroupProperties(); - } - this.innerProperties().withAllowCrashDumpsCollection(allowCrashDumpsCollection); - return this; + public DeviceGroupInner() { } /** - * Get the regionalDataBoundary property: Regional data boundary for the device group. - * - * @return the regionalDataBoundary value. + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - public RegionalDataBoundary regionalDataBoundary() { - return this.innerProperties() == null ? null : this.innerProperties().regionalDataBoundary(); + public DeviceGroupProperties properties() { + return this.properties; } /** - * Set the regionalDataBoundary property: Regional data boundary for the device group. - * - * @param regionalDataBoundary the regionalDataBoundary value to set. + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. * @return the DeviceGroupInner object itself. */ - public DeviceGroupInner withRegionalDataBoundary(RegionalDataBoundary regionalDataBoundary) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceGroupProperties(); - } - this.innerProperties().withRegionalDataBoundary(regionalDataBoundary); + public DeviceGroupInner withProperties(DeviceGroupProperties properties) { + this.properties = properties; return this; } /** - * Get the hasDeployment property: Deployment status for the device group. - * - * @return the hasDeployment value. - */ - public Boolean hasDeployment() { - return this.innerProperties() == null ? null : this.innerProperties().hasDeployment(); - } - - /** - * Get the provisioningState property: The status of the last operation. - * - * @return the provisioningState value. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + public SystemData systemData() { + return this.systemData; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceInner.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceInner.java index 4d6a8dfe174b8..5e37559821520 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceInner.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceInner.java @@ -6,117 +6,70 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.sphere.models.ProvisioningState; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.sphere.models.DeviceProperties; import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -/** An device resource belonging to a device group resource. */ +/** + * An device resource belonging to a device group resource. + */ @Fluent public final class DeviceInner extends ProxyResource { /* * The resource-specific properties for this resource. */ @JsonProperty(value = "properties") - private DeviceProperties innerProperties; + private DeviceProperties properties; - /** Creates an instance of DeviceInner class. */ - public DeviceInner() { - } + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /** - * Get the innerProperties property: The resource-specific properties for this resource. - * - * @return the innerProperties value. + * Creates an instance of DeviceInner class. */ - private DeviceProperties innerProperties() { - return this.innerProperties; + public DeviceInner() { } /** - * Get the deviceId property: Device ID. - * - * @return the deviceId value. + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - public String deviceId() { - return this.innerProperties() == null ? null : this.innerProperties().deviceId(); + public DeviceProperties properties() { + return this.properties; } /** - * Set the deviceId property: Device ID. - * - * @param deviceId the deviceId value to set. + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. * @return the DeviceInner object itself. */ - public DeviceInner withDeviceId(String deviceId) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceProperties(); - } - this.innerProperties().withDeviceId(deviceId); + public DeviceInner withProperties(DeviceProperties properties) { + this.properties = properties; return this; } /** - * Get the chipSku property: SKU of the chip. - * - * @return the chipSku value. - */ - public String chipSku() { - return this.innerProperties() == null ? null : this.innerProperties().chipSku(); - } - - /** - * Get the lastAvailableOsVersion property: OS version available for installation when update requested. - * - * @return the lastAvailableOsVersion value. - */ - public String lastAvailableOsVersion() { - return this.innerProperties() == null ? null : this.innerProperties().lastAvailableOsVersion(); - } - - /** - * Get the lastInstalledOsVersion property: OS version running on device when update requested. - * - * @return the lastInstalledOsVersion value. - */ - public String lastInstalledOsVersion() { - return this.innerProperties() == null ? null : this.innerProperties().lastInstalledOsVersion(); - } - - /** - * Get the lastOsUpdateUtc property: Time when update requested and new OS version available. - * - * @return the lastOsUpdateUtc value. - */ - public OffsetDateTime lastOsUpdateUtc() { - return this.innerProperties() == null ? null : this.innerProperties().lastOsUpdateUtc(); - } - - /** - * Get the lastUpdateRequestUtc property: Time when update was last requested. - * - * @return the lastUpdateRequestUtc value. - */ - public OffsetDateTime lastUpdateRequestUtc() { - return this.innerProperties() == null ? null : this.innerProperties().lastUpdateRequestUtc(); - } - - /** - * Get the provisioningState property: The status of the last operation. - * - * @return the provisioningState value. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + public SystemData systemData() { + return this.systemData; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceInsightInner.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceInsightInner.java index 4290335b8721a..26e8172ee6491 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceInsightInner.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceInsightInner.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** Device insight report. */ +/** + * Device insight report. + */ @Fluent public final class DeviceInsightInner { /* @@ -60,13 +62,15 @@ public final class DeviceInsightInner { @JsonProperty(value = "eventCount", required = true) private int eventCount; - /** Creates an instance of DeviceInsightInner class. */ + /** + * Creates an instance of DeviceInsightInner class. + */ public DeviceInsightInner() { } /** * Get the deviceId property: Device ID. - * + * * @return the deviceId value. */ public String deviceId() { @@ -75,7 +79,7 @@ public String deviceId() { /** * Set the deviceId property: Device ID. - * + * * @param deviceId the deviceId value to set. * @return the DeviceInsightInner object itself. */ @@ -86,7 +90,7 @@ public DeviceInsightInner withDeviceId(String deviceId) { /** * Get the description property: Event description. - * + * * @return the description value. */ public String description() { @@ -95,7 +99,7 @@ public String description() { /** * Set the description property: Event description. - * + * * @param description the description value to set. * @return the DeviceInsightInner object itself. */ @@ -106,7 +110,7 @@ public DeviceInsightInner withDescription(String description) { /** * Get the startTimestampUtc property: Event start timestamp. - * + * * @return the startTimestampUtc value. */ public OffsetDateTime startTimestampUtc() { @@ -115,7 +119,7 @@ public OffsetDateTime startTimestampUtc() { /** * Set the startTimestampUtc property: Event start timestamp. - * + * * @param startTimestampUtc the startTimestampUtc value to set. * @return the DeviceInsightInner object itself. */ @@ -126,7 +130,7 @@ public DeviceInsightInner withStartTimestampUtc(OffsetDateTime startTimestampUtc /** * Get the endTimestampUtc property: Event end timestamp. - * + * * @return the endTimestampUtc value. */ public OffsetDateTime endTimestampUtc() { @@ -135,7 +139,7 @@ public OffsetDateTime endTimestampUtc() { /** * Set the endTimestampUtc property: Event end timestamp. - * + * * @param endTimestampUtc the endTimestampUtc value to set. * @return the DeviceInsightInner object itself. */ @@ -146,7 +150,7 @@ public DeviceInsightInner withEndTimestampUtc(OffsetDateTime endTimestampUtc) { /** * Get the eventCategory property: Event category. - * + * * @return the eventCategory value. */ public String eventCategory() { @@ -155,7 +159,7 @@ public String eventCategory() { /** * Set the eventCategory property: Event category. - * + * * @param eventCategory the eventCategory value to set. * @return the DeviceInsightInner object itself. */ @@ -166,7 +170,7 @@ public DeviceInsightInner withEventCategory(String eventCategory) { /** * Get the eventClass property: Event class. - * + * * @return the eventClass value. */ public String eventClass() { @@ -175,7 +179,7 @@ public String eventClass() { /** * Set the eventClass property: Event class. - * + * * @param eventClass the eventClass value to set. * @return the DeviceInsightInner object itself. */ @@ -186,7 +190,7 @@ public DeviceInsightInner withEventClass(String eventClass) { /** * Get the eventType property: Event type. - * + * * @return the eventType value. */ public String eventType() { @@ -195,7 +199,7 @@ public String eventType() { /** * Set the eventType property: Event type. - * + * * @param eventType the eventType value to set. * @return the DeviceInsightInner object itself. */ @@ -206,7 +210,7 @@ public DeviceInsightInner withEventType(String eventType) { /** * Get the eventCount property: Event count. - * + * * @return the eventCount value. */ public int eventCount() { @@ -215,7 +219,7 @@ public int eventCount() { /** * Set the eventCount property: Event count. - * + * * @param eventCount the eventCount value to set. * @return the DeviceInsightInner object itself. */ @@ -226,47 +230,37 @@ public DeviceInsightInner withEventCount(int eventCount) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (deviceId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property deviceId in model DeviceInsightInner")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property deviceId in model DeviceInsightInner")); } if (description() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property description in model DeviceInsightInner")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property description in model DeviceInsightInner")); } if (startTimestampUtc() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property startTimestampUtc in model DeviceInsightInner")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property startTimestampUtc in model DeviceInsightInner")); } if (endTimestampUtc() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property endTimestampUtc in model DeviceInsightInner")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property endTimestampUtc in model DeviceInsightInner")); } if (eventCategory() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property eventCategory in model DeviceInsightInner")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property eventCategory in model DeviceInsightInner")); } if (eventClass() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property eventClass in model DeviceInsightInner")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property eventClass in model DeviceInsightInner")); } if (eventType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property eventType in model DeviceInsightInner")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property eventType in model DeviceInsightInner")); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ImageInner.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ImageInner.java index 7f5a89784b1f0..d7bb5032b0f7a 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ImageInner.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ImageInner.java @@ -6,166 +6,70 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.sphere.models.ImageType; -import com.azure.resourcemanager.sphere.models.ProvisioningState; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.sphere.models.ImageProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** An image resource belonging to a catalog resource. */ +/** + * An image resource belonging to a catalog resource. + */ @Fluent public final class ImageInner extends ProxyResource { /* * The resource-specific properties for this resource. */ @JsonProperty(value = "properties") - private ImageProperties innerProperties; + private ImageProperties properties; - /** Creates an instance of ImageInner class. */ - public ImageInner() { - } - - /** - * Get the innerProperties property: The resource-specific properties for this resource. - * - * @return the innerProperties value. - */ - private ImageProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the image property: Image as a UTF-8 encoded base 64 string on image create. This field contains the image - * URI on image reads. - * - * @return the image value. - */ - public String image() { - return this.innerProperties() == null ? null : this.innerProperties().image(); - } - - /** - * Set the image property: Image as a UTF-8 encoded base 64 string on image create. This field contains the image - * URI on image reads. - * - * @param image the image value to set. - * @return the ImageInner object itself. - */ - public ImageInner withImage(String image) { - if (this.innerProperties() == null) { - this.innerProperties = new ImageProperties(); - } - this.innerProperties().withImage(image); - return this; - } - - /** - * Get the imageId property: Image ID. - * - * @return the imageId value. - */ - public String imageId() { - return this.innerProperties() == null ? null : this.innerProperties().imageId(); - } - - /** - * Set the imageId property: Image ID. - * - * @param imageId the imageId value to set. - * @return the ImageInner object itself. + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - public ImageInner withImageId(String imageId) { - if (this.innerProperties() == null) { - this.innerProperties = new ImageProperties(); - } - this.innerProperties().withImageId(imageId); - return this; - } + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /** - * Get the imageName property: Image name. - * - * @return the imageName value. + * Creates an instance of ImageInner class. */ - public String imageName() { - return this.innerProperties() == null ? null : this.innerProperties().imageName(); + public ImageInner() { } /** - * Get the regionalDataBoundary property: Regional data boundary for an image. - * - * @return the regionalDataBoundary value. + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - public RegionalDataBoundary regionalDataBoundary() { - return this.innerProperties() == null ? null : this.innerProperties().regionalDataBoundary(); + public ImageProperties properties() { + return this.properties; } /** - * Set the regionalDataBoundary property: Regional data boundary for an image. - * - * @param regionalDataBoundary the regionalDataBoundary value to set. + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. * @return the ImageInner object itself. */ - public ImageInner withRegionalDataBoundary(RegionalDataBoundary regionalDataBoundary) { - if (this.innerProperties() == null) { - this.innerProperties = new ImageProperties(); - } - this.innerProperties().withRegionalDataBoundary(regionalDataBoundary); + public ImageInner withProperties(ImageProperties properties) { + this.properties = properties; return this; } /** - * Get the uri property: Location the image. - * - * @return the uri value. - */ - public String uri() { - return this.innerProperties() == null ? null : this.innerProperties().uri(); - } - - /** - * Get the description property: The image description. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the componentId property: The image component id. - * - * @return the componentId value. - */ - public String componentId() { - return this.innerProperties() == null ? null : this.innerProperties().componentId(); - } - - /** - * Get the imageType property: The image type. - * - * @return the imageType value. - */ - public ImageType imageType() { - return this.innerProperties() == null ? null : this.innerProperties().imageType(); - } - - /** - * Get the provisioningState property: The status of the last operation. - * - * @return the provisioningState value. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + public SystemData systemData() { + return this.systemData; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/OperationInner.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/OperationInner.java index 239055d7f0702..dfc05b47ebf82 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/OperationInner.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/OperationInner.java @@ -12,8 +12,8 @@ /** * REST API Operation - * - *

Details of a REST API operation, returned from the Resource Provider Operations API. + * + * Details of a REST API operation, returned from the Resource Provider Operations API. */ @Fluent public final class OperationInner { @@ -50,14 +50,16 @@ public final class OperationInner { @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) private ActionType actionType; - /** Creates an instance of OperationInner class. */ + /** + * Creates an instance of OperationInner class. + */ public OperationInner() { } /** * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * + * * @return the name value. */ public String name() { @@ -67,7 +69,7 @@ public String name() { /** * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane * operations and "false" for ARM/control-plane operations. - * + * * @return the isDataAction value. */ public Boolean isDataAction() { @@ -76,7 +78,7 @@ public Boolean isDataAction() { /** * Get the display property: Localized display information for this particular operation. - * + * * @return the display value. */ public OperationDisplay display() { @@ -85,7 +87,7 @@ public OperationDisplay display() { /** * Set the display property: Localized display information for this particular operation. - * + * * @param display the display value to set. * @return the OperationInner object itself. */ @@ -97,7 +99,7 @@ public OperationInner withDisplay(OperationDisplay display) { /** * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and * audit logs UX. Default value is "user,system". - * + * * @return the origin value. */ public Origin origin() { @@ -107,7 +109,7 @@ public Origin origin() { /** * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal * only APIs. - * + * * @return the actionType value. */ public ActionType actionType() { @@ -116,7 +118,7 @@ public ActionType actionType() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProductInner.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProductInner.java index c5a3f9cc1d70a..a4bb450d3b9a4 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProductInner.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProductInner.java @@ -6,71 +6,70 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.sphere.models.ProvisioningState; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.sphere.models.ProductProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** An product resource belonging to a catalog resource. */ +/** + * An product resource belonging to a catalog resource. + */ @Fluent public final class ProductInner extends ProxyResource { /* * The resource-specific properties for this resource. */ @JsonProperty(value = "properties") - private ProductProperties innerProperties; + private ProductProperties properties; - /** Creates an instance of ProductInner class. */ - public ProductInner() { - } + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; /** - * Get the innerProperties property: The resource-specific properties for this resource. - * - * @return the innerProperties value. + * Creates an instance of ProductInner class. */ - private ProductProperties innerProperties() { - return this.innerProperties; + public ProductInner() { } /** - * Get the description property: Description of the product. - * - * @return the description value. + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); + public ProductProperties properties() { + return this.properties; } /** - * Set the description property: Description of the product. - * - * @param description the description value to set. + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. * @return the ProductInner object itself. */ - public ProductInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new ProductProperties(); - } - this.innerProperties().withDescription(description); + public ProductInner withProperties(ProductProperties properties) { + this.properties = properties; return this; } /** - * Get the provisioningState property: The status of the last operation. - * - * @return the provisioningState value. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + public SystemData systemData() { + return this.systemData; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProofOfPossessionNonceResponseInner.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProofOfPossessionNonceResponseInner.java index ee5f94ce18c2f..a1582786030f5 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProofOfPossessionNonceResponseInner.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProofOfPossessionNonceResponseInner.java @@ -5,17 +5,22 @@ package com.azure.resourcemanager.sphere.fluent.models; import com.azure.core.annotation.Immutable; +import com.azure.resourcemanager.sphere.models.CertificateProperties; -/** Result of the action to generate a proof of possession nonce. */ +/** + * Result of the action to generate a proof of possession nonce. + */ @Immutable public final class ProofOfPossessionNonceResponseInner extends CertificateProperties { - /** Creates an instance of ProofOfPossessionNonceResponseInner class. */ + /** + * Creates an instance of ProofOfPossessionNonceResponseInner class. + */ public ProofOfPossessionNonceResponseInner() { } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/SignedCapabilityImageResponseInner.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/SignedCapabilityImageResponseInner.java index 1822b0e457228..e493a98d9a8e7 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/SignedCapabilityImageResponseInner.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/SignedCapabilityImageResponseInner.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Signed device capability image response. */ +/** + * Signed device capability image response. + */ @Immutable public final class SignedCapabilityImageResponseInner { /* @@ -16,13 +18,15 @@ public final class SignedCapabilityImageResponseInner { @JsonProperty(value = "image", access = JsonProperty.Access.WRITE_ONLY) private String image; - /** Creates an instance of SignedCapabilityImageResponseInner class. */ + /** + * Creates an instance of SignedCapabilityImageResponseInner class. + */ public SignedCapabilityImageResponseInner() { } /** * Get the image property: The signed device capability image as a UTF-8 encoded base 64 string. - * + * * @return the image value. */ public String image() { @@ -31,7 +35,7 @@ public String image() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/package-info.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/package-info.java index 6c295b60279c0..44b34f3f416cd 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/package-info.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the inner data models for AzureSphereManagementClient. Azure Sphere resource management API. */ +/** + * Package containing the inner data models for AzureSphereMgmtClient. + * Azure Sphere resource management API. + */ package com.azure.resourcemanager.sphere.fluent.models; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/package-info.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/package-info.java index 9853cc0ca23a1..725f0e0fae443 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/package-info.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the service clients for AzureSphereManagementClient. Azure Sphere resource management API. */ +/** + * Package containing the service clients for AzureSphereMgmtClient. + * Azure Sphere resource management API. + */ package com.azure.resourcemanager.sphere.fluent; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereManagementClientBuilder.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereMgmtClientBuilder.java similarity index 54% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereManagementClientBuilder.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereMgmtClientBuilder.java index 6f5c108a3bba2..b241c95719877 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereManagementClientBuilder.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereMgmtClientBuilder.java @@ -14,9 +14,11 @@ import com.azure.core.util.serializer.SerializerAdapter; import java.time.Duration; -/** A builder for creating a new instance of the AzureSphereManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {AzureSphereManagementClientImpl.class}) -public final class AzureSphereManagementClientBuilder { +/** + * A builder for creating a new instance of the AzureSphereMgmtClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { AzureSphereMgmtClientImpl.class }) +public final class AzureSphereMgmtClientBuilder { /* * The ID of the target subscription. */ @@ -24,11 +26,11 @@ public final class AzureSphereManagementClientBuilder { /** * Sets The ID of the target subscription. - * + * * @param subscriptionId the subscriptionId value. - * @return the AzureSphereManagementClientBuilder. + * @return the AzureSphereMgmtClientBuilder. */ - public AzureSphereManagementClientBuilder subscriptionId(String subscriptionId) { + public AzureSphereMgmtClientBuilder subscriptionId(String subscriptionId) { this.subscriptionId = subscriptionId; return this; } @@ -40,11 +42,11 @@ public AzureSphereManagementClientBuilder subscriptionId(String subscriptionId) /** * Sets server parameter. - * + * * @param endpoint the endpoint value. - * @return the AzureSphereManagementClientBuilder. + * @return the AzureSphereMgmtClientBuilder. */ - public AzureSphereManagementClientBuilder endpoint(String endpoint) { + public AzureSphereMgmtClientBuilder endpoint(String endpoint) { this.endpoint = endpoint; return this; } @@ -56,11 +58,11 @@ public AzureSphereManagementClientBuilder endpoint(String endpoint) { /** * Sets The environment to connect to. - * + * * @param environment the environment value. - * @return the AzureSphereManagementClientBuilder. + * @return the AzureSphereMgmtClientBuilder. */ - public AzureSphereManagementClientBuilder environment(AzureEnvironment environment) { + public AzureSphereMgmtClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -72,11 +74,11 @@ public AzureSphereManagementClientBuilder environment(AzureEnvironment environme /** * Sets The HTTP pipeline to send requests through. - * + * * @param pipeline the pipeline value. - * @return the AzureSphereManagementClientBuilder. + * @return the AzureSphereMgmtClientBuilder. */ - public AzureSphereManagementClientBuilder pipeline(HttpPipeline pipeline) { + public AzureSphereMgmtClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -88,11 +90,11 @@ public AzureSphereManagementClientBuilder pipeline(HttpPipeline pipeline) { /** * Sets The default poll interval for long-running operation. - * + * * @param defaultPollInterval the defaultPollInterval value. - * @return the AzureSphereManagementClientBuilder. + * @return the AzureSphereMgmtClientBuilder. */ - public AzureSphereManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + public AzureSphereMgmtClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -104,41 +106,31 @@ public AzureSphereManagementClientBuilder defaultPollInterval(Duration defaultPo /** * Sets The serializer to serialize an object into a string. - * + * * @param serializerAdapter the serializerAdapter value. - * @return the AzureSphereManagementClientBuilder. + * @return the AzureSphereMgmtClientBuilder. */ - public AzureSphereManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public AzureSphereMgmtClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of AzureSphereManagementClientImpl with the provided parameters. - * - * @return an instance of AzureSphereManagementClientImpl. + * Builds an instance of AzureSphereMgmtClientImpl with the provided parameters. + * + * @return an instance of AzureSphereMgmtClientImpl. */ - public AzureSphereManagementClientImpl buildClient() { + public AzureSphereMgmtClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = - (pipeline != null) - ? pipeline - : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - Duration localDefaultPollInterval = - (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = - (serializerAdapter != null) - ? serializerAdapter - : SerializerFactory.createDefaultManagementSerializerAdapter(); - AzureSphereManagementClientImpl client = - new AzureSphereManagementClientImpl( - localPipeline, - localSerializerAdapter, - localDefaultPollInterval, - localEnvironment, - subscriptionId, - localEndpoint); + HttpPipeline localPipeline = (pipeline != null) ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + AzureSphereMgmtClientImpl client = new AzureSphereMgmtClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); return client; } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereManagementClientImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereMgmtClientImpl.java similarity index 80% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereManagementClientImpl.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereMgmtClientImpl.java index 251919142566f..17c8f69d4d40d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereManagementClientImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/AzureSphereMgmtClientImpl.java @@ -22,7 +22,7 @@ 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.sphere.fluent.AzureSphereManagementClient; +import com.azure.resourcemanager.sphere.fluent.AzureSphereMgmtClient; import com.azure.resourcemanager.sphere.fluent.CatalogsClient; import com.azure.resourcemanager.sphere.fluent.CertificatesClient; import com.azure.resourcemanager.sphere.fluent.DeploymentsClient; @@ -40,171 +40,201 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the AzureSphereManagementClientImpl type. */ -@ServiceClient(builder = AzureSphereManagementClientBuilder.class) -public final class AzureSphereManagementClientImpl implements AzureSphereManagementClient { - /** The ID of the target subscription. */ +/** + * Initializes a new instance of the AzureSphereMgmtClientImpl type. + */ +@ServiceClient(builder = AzureSphereMgmtClientBuilder.class) +public final class AzureSphereMgmtClientImpl implements AzureSphereMgmtClient { + /** + * 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. */ + /** + * server parameter. + */ private final String endpoint; /** * Gets server parameter. - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** Api Version. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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. */ + /** + * 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 CatalogsClient object to access its operations. */ + /** + * The CatalogsClient object to access its operations. + */ private final CatalogsClient catalogs; /** * Gets the CatalogsClient object to access its operations. - * + * * @return the CatalogsClient object. */ public CatalogsClient getCatalogs() { return this.catalogs; } - /** The CertificatesClient object to access its operations. */ + /** + * 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 ImagesClient object to access its operations. */ + /** + * 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 ProductsClient object to access its operations. */ + /** + * The ProductsClient object to access its operations. + */ private final ProductsClient products; /** * Gets the ProductsClient object to access its operations. - * + * * @return the ProductsClient object. */ public ProductsClient getProducts() { return this.products; } - /** The DeviceGroupsClient object to access its operations. */ + /** + * The DeviceGroupsClient object to access its operations. + */ private final DeviceGroupsClient deviceGroups; /** * Gets the DeviceGroupsClient object to access its operations. - * + * * @return the DeviceGroupsClient object. */ public DeviceGroupsClient getDeviceGroups() { return this.deviceGroups; } - /** The DeploymentsClient object to access its 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 DevicesClient object to access its operations. */ + /** + * The DevicesClient object to access its operations. + */ private final DevicesClient devices; /** * Gets the DevicesClient object to access its operations. - * + * * @return the DevicesClient object. */ public DevicesClient getDevices() { @@ -212,8 +242,8 @@ public DevicesClient getDevices() { } /** - * Initializes an instance of AzureSphereManagementClient client. - * + * Initializes an instance of AzureSphereMgmtClient 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. @@ -221,19 +251,14 @@ public DevicesClient getDevices() { * @param subscriptionId The ID of the target subscription. * @param endpoint server parameter. */ - AzureSphereManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { + AzureSphereMgmtClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2022-09-01-preview"; + this.apiVersion = "2024-04-01"; this.operations = new OperationsClientImpl(this); this.catalogs = new CatalogsClientImpl(this); this.certificates = new CertificatesClientImpl(this); @@ -246,7 +271,7 @@ public DevicesClient getDevices() { /** * Gets default client context. - * + * * @return the default client context. */ public Context getContext() { @@ -255,7 +280,7 @@ public Context getContext() { /** * Merges default client context with provided context. - * + * * @param context the context to be merged with default client context. * @return the merged context. */ @@ -265,7 +290,7 @@ public Context mergeContext(Context context) { /** * Gets long running operation result. - * + * * @param activationResponse the response of activation operation. * @param httpPipeline the http pipeline. * @param pollResultType type of poll result. @@ -275,26 +300,15 @@ public Context mergeContext(Context context) { * @param type of final result. * @return poller flux for poll result and final result. */ - public PollerFlux, U> getLroResult( - Mono>> activationResponse, - HttpPipeline httpPipeline, - Type pollResultType, - Type finalResultType, - Context context) { - return PollerFactory - .create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - activationResponse, - context); + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, 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. @@ -307,19 +321,16 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, HttpResponse errorResponse = null; PollResult.Error lroError = response.getValue().getError(); if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + 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); + managementError = this.getSerializerAdapter().deserialize(errorBody, ManagementError.class, + SerializerEncoding.JSON); if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } @@ -384,5 +395,5 @@ public Mono getBodyAsString(Charset charset) { } } - private static final ClientLogger LOGGER = new ClientLogger(AzureSphereManagementClientImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(AzureSphereMgmtClientImpl.class); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogImpl.java index e36df7131263a..9ffba680cbfe7 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogImpl.java @@ -10,15 +10,16 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.sphere.fluent.models.CatalogInner; +import com.azure.resourcemanager.sphere.fluent.models.ImageInner; import com.azure.resourcemanager.sphere.models.Catalog; +import com.azure.resourcemanager.sphere.models.CatalogProperties; import com.azure.resourcemanager.sphere.models.CatalogUpdate; -import com.azure.resourcemanager.sphere.models.CountDeviceResponse; +import com.azure.resourcemanager.sphere.models.CountDevicesResponse; import com.azure.resourcemanager.sphere.models.Deployment; import com.azure.resourcemanager.sphere.models.Device; import com.azure.resourcemanager.sphere.models.DeviceGroup; import com.azure.resourcemanager.sphere.models.DeviceInsight; import com.azure.resourcemanager.sphere.models.ListDeviceGroupsRequest; -import com.azure.resourcemanager.sphere.models.ProvisioningState; import java.util.Collections; import java.util.Map; @@ -52,12 +53,12 @@ public Map tags() { } } - public SystemData systemData() { - return this.innerModel().systemData(); + public CatalogProperties properties() { + return this.innerModel().properties(); } - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public Region region() { @@ -92,20 +93,14 @@ public CatalogImpl withExistingResourceGroup(String resourceGroupName) { } public Catalog create() { - this.innerObject = - serviceManager - .serviceClient() - .getCatalogs() - .createOrUpdate(resourceGroupName, catalogName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient().getCatalogs().createOrUpdate(resourceGroupName, catalogName, + this.innerModel(), Context.NONE); return this; } public Catalog create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getCatalogs() - .createOrUpdate(resourceGroupName, catalogName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient().getCatalogs().createOrUpdate(resourceGroupName, catalogName, + this.innerModel(), context); return this; } @@ -121,57 +116,41 @@ public CatalogImpl update() { } public Catalog apply() { - this.innerObject = - serviceManager - .serviceClient() - .getCatalogs() - .updateWithResponse(resourceGroupName, catalogName, updateProperties, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getCatalogs() + .updateWithResponse(resourceGroupName, catalogName, updateProperties, Context.NONE).getValue(); return this; } public Catalog apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getCatalogs() - .updateWithResponse(resourceGroupName, catalogName, updateProperties, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getCatalogs() + .updateWithResponse(resourceGroupName, catalogName, updateProperties, context).getValue(); return this; } CatalogImpl(CatalogInner innerObject, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.catalogName = Utils.getValueFromIdByName(innerObject.id(), "catalogs"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.catalogName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "catalogs"); } public Catalog refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getCatalogs() - .getByResourceGroupWithResponse(resourceGroupName, catalogName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getCatalogs() + .getByResourceGroupWithResponse(resourceGroupName, catalogName, Context.NONE).getValue(); return this; } public Catalog refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getCatalogs() - .getByResourceGroupWithResponse(resourceGroupName, catalogName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getCatalogs() + .getByResourceGroupWithResponse(resourceGroupName, catalogName, context).getValue(); return this; } - public Response countDevicesWithResponse(Context context) { + public Response countDevicesWithResponse(Context context) { return serviceManager.catalogs().countDevicesWithResponse(resourceGroupName, catalogName, context); } - public CountDeviceResponse countDevices() { + public CountDevicesResponse countDevices() { return serviceManager.catalogs().countDevices(resourceGroupName, catalogName); } @@ -179,50 +158,48 @@ public PagedIterable listDeployments() { return serviceManager.catalogs().listDeployments(resourceGroupName, catalogName); } - public PagedIterable listDeployments( - String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { - return serviceManager - .catalogs() - .listDeployments(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context); + public PagedIterable listDeployments(String filter, Integer top, Integer skip, Integer maxpagesize, + Context context) { + return serviceManager.catalogs().listDeployments(resourceGroupName, catalogName, filter, top, skip, maxpagesize, + context); } public PagedIterable listDeviceGroups(ListDeviceGroupsRequest listDeviceGroupsRequest) { return serviceManager.catalogs().listDeviceGroups(resourceGroupName, catalogName, listDeviceGroupsRequest); } - public PagedIterable listDeviceGroups( - ListDeviceGroupsRequest listDeviceGroupsRequest, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { - return serviceManager - .catalogs() - .listDeviceGroups( - resourceGroupName, catalogName, listDeviceGroupsRequest, filter, top, skip, maxpagesize, context); + public PagedIterable listDeviceGroups(ListDeviceGroupsRequest listDeviceGroupsRequest, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context) { + return serviceManager.catalogs().listDeviceGroups(resourceGroupName, catalogName, listDeviceGroupsRequest, + filter, top, skip, maxpagesize, context); } public PagedIterable listDeviceInsights() { return serviceManager.catalogs().listDeviceInsights(resourceGroupName, catalogName); } - public PagedIterable listDeviceInsights( - String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { - return serviceManager - .catalogs() - .listDeviceInsights(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context); + public PagedIterable listDeviceInsights(String filter, Integer top, Integer skip, + Integer maxpagesize, Context context) { + return serviceManager.catalogs().listDeviceInsights(resourceGroupName, catalogName, filter, top, skip, + maxpagesize, context); } public PagedIterable listDevices() { return serviceManager.catalogs().listDevices(resourceGroupName, catalogName); } - public PagedIterable listDevices( - String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { - return serviceManager - .catalogs() - .listDevices(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context); + public PagedIterable listDevices(String filter, Integer top, Integer skip, Integer maxpagesize, + Context context) { + return serviceManager.catalogs().listDevices(resourceGroupName, catalogName, filter, top, skip, maxpagesize, + context); + } + + public void uploadImage(ImageInner uploadImageRequest) { + serviceManager.catalogs().uploadImage(resourceGroupName, catalogName, uploadImageRequest); + } + + public void uploadImage(ImageInner uploadImageRequest, Context context) { + serviceManager.catalogs().uploadImage(resourceGroupName, catalogName, uploadImageRequest, context); } public CatalogImpl withRegion(Region location) { @@ -245,6 +222,11 @@ public CatalogImpl withTags(Map tags) { } } + public CatalogImpl withProperties(CatalogProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogsClientImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogsClientImpl.java index aab63c3693db3..2c20fb1e1cb77 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogsClientImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogsClientImpl.java @@ -35,11 +35,12 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.sphere.fluent.CatalogsClient; import com.azure.resourcemanager.sphere.fluent.models.CatalogInner; -import com.azure.resourcemanager.sphere.fluent.models.CountDeviceResponseInner; +import com.azure.resourcemanager.sphere.fluent.models.CountDevicesResponseInner; import com.azure.resourcemanager.sphere.fluent.models.DeploymentInner; import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner; import com.azure.resourcemanager.sphere.fluent.models.DeviceInner; import com.azure.resourcemanager.sphere.fluent.models.DeviceInsightInner; +import com.azure.resourcemanager.sphere.fluent.models.ImageInner; import com.azure.resourcemanager.sphere.models.CatalogListResult; import com.azure.resourcemanager.sphere.models.CatalogUpdate; import com.azure.resourcemanager.sphere.models.DeploymentListResult; @@ -51,366 +52,276 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in CatalogsClient. */ +/** + * An instance of this class provides access to all the operations defined in CatalogsClient. + */ public final class CatalogsClientImpl implements CatalogsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final CatalogsService service; - /** The service client containing this operation class. */ - private final AzureSphereManagementClientImpl client; + /** + * The service client containing this operation class. + */ + private final AzureSphereMgmtClientImpl client; /** * Initializes an instance of CatalogsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - CatalogsClientImpl(AzureSphereManagementClientImpl client) { + CatalogsClientImpl(AzureSphereMgmtClientImpl client) { this.service = RestProxy.create(CatalogsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureSphereManagementClientCatalogs to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for AzureSphereMgmtClientCatalogs to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "AzureSphereManagemen") + @ServiceInterface(name = "AzureSphereMgmtClien") public interface CatalogsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzureSphere/catalogs") - @ExpectedResponses({200}) + @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); + 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.AzureSphere/catalogs") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs") + @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, + 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.AzureSphere/catalogs/{catalogName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}") + @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("catalogName") String catalogName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}") - @ExpectedResponses({200, 201}) + Mono> getByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}") + @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("catalogName") String catalogName, - @BodyParam("application/json") CatalogInner resource, - @HeaderParam("Accept") String accept, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @BodyParam("application/json") CatalogInner resource, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}") + @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("catalogName") String catalogName, - @BodyParam("application/json") CatalogUpdate properties, - @HeaderParam("Accept") String accept, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @BodyParam("application/json") CatalogUpdate properties, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}") + @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("catalogName") String catalogName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/countDevices") - @ExpectedResponses({200}) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/countDevices") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> countDevices( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDeployments") - @ExpectedResponses({200}) + Mono> countDevices(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDeployments") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDeployments( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @QueryParam("$skip") Integer skip, - @QueryParam("$maxpagesize") Integer maxpagesize, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDeviceGroups") - @ExpectedResponses({200}) + Mono> listDeployments(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDeviceGroups") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDeviceGroups( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @QueryParam("$skip") Integer skip, - @QueryParam("$maxpagesize") Integer maxpagesize, + Mono> listDeviceGroups(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, @BodyParam("application/json") ListDeviceGroupsRequest listDeviceGroupsRequest, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDeviceInsights") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDeviceInsights") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDeviceInsights( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @QueryParam("$skip") Integer skip, - @QueryParam("$maxpagesize") Integer maxpagesize, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDevices") - @ExpectedResponses({200}) + Mono> listDeviceInsights(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/listDevices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listDevices(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/uploadImage") + @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDevices( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @QueryParam("$skip") Integer skip, - @QueryParam("$maxpagesize") Integer maxpagesize, - @HeaderParam("Accept") String accept, + Mono>> uploadImage(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @BodyParam("application/json") ImageInner uploadImageRequest, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listDeploymentsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listDeviceGroupsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listDeviceInsightsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listDevicesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listDevicesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * List Catalog resources by subscription ID. - * + * * @throws ManagementException thrown 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 a Catalog list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 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)) + .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())); } /** * List Catalog resources by subscription 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 of a Catalog list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(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, + .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)); + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List Catalog resources by subscription ID. - * + * * @throws ManagementException thrown 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 a Catalog list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * List Catalog resources by subscription 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. @@ -419,13 +330,13 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** * List Catalog resources by subscription ID. - * + * * @throws ManagementException thrown 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 a Catalog list operation as paginated response with {@link PagedIterable}. @@ -437,7 +348,7 @@ public PagedIterable list() { /** * List Catalog resources by subscription 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. @@ -451,27 +362,23 @@ public PagedIterable list(Context context) { /** * List Catalog resources by 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 of a Catalog list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -479,53 +386,34 @@ private Mono> listByResourceGroupSinglePageAsync(Str } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + 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())); } /** * List Catalog resources by 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 the response of a Catalog list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -534,27 +422,15 @@ private Mono> listByResourceGroupSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List Catalog resources by 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. @@ -563,14 +439,13 @@ private Mono> listByResourceGroupSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * List Catalog resources by 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. @@ -580,14 +455,13 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** * List Catalog resources by 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. @@ -601,7 +475,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName) /** * List Catalog resources by 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. @@ -616,7 +490,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName, /** * Get a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -625,19 +499,15 @@ public PagedIterable listByResourceGroup(String resourceGroupName, * @return a Catalog along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String catalogName) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String catalogName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -648,23 +518,14 @@ private Mono> getByResourceGroupWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - accept, - context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -674,19 +535,15 @@ private Mono> getByResourceGroupWithResponseAsync( * @return a Catalog along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String catalogName, Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String catalogName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -697,20 +554,13 @@ private Mono> getByResourceGroupWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - accept, - context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, accept, context); } /** * Get a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -726,7 +576,7 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str /** * Get a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -736,14 +586,14 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str * @return a Catalog along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String catalogName, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, String catalogName, + Context context) { return getByResourceGroupWithResponseAsync(resourceGroupName, catalogName, context).block(); } /** * Get a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -758,7 +608,7 @@ public CatalogInner getByResourceGroup(String resourceGroupName, String catalogN /** * Create a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param resource Resource create parameters. @@ -768,19 +618,15 @@ public CatalogInner getByResourceGroup(String resourceGroupName, String catalogN * @return an Azure Sphere catalog along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String catalogName, CatalogInner resource) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String catalogName, CatalogInner resource) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -796,24 +642,14 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - resource, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, resource, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param resource Resource create parameters. @@ -824,19 +660,15 @@ private Mono>> createOrUpdateWithResponseAsync( * @return an Azure Sphere catalog along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String catalogName, CatalogInner resource, Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String catalogName, CatalogInner resource, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -852,21 +684,13 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - resource, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, resource, accept, context); } /** * Create a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param resource Resource create parameters. @@ -876,19 +700,17 @@ private Mono>> createOrUpdateWithResponseAsync( * @return the {@link PollerFlux} for polling of an Azure Sphere catalog. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CatalogInner> beginCreateOrUpdateAsync( - String resourceGroupName, String catalogName, CatalogInner resource) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, catalogName, resource); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), CatalogInner.class, CatalogInner.class, this.client.getContext()); + private PollerFlux, CatalogInner> beginCreateOrUpdateAsync(String resourceGroupName, + String catalogName, CatalogInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CatalogInner.class, CatalogInner.class, this.client.getContext()); } /** * Create a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param resource Resource create parameters. @@ -899,20 +721,18 @@ private PollerFlux, CatalogInner> beginCreateOrUpdateAs * @return the {@link PollerFlux} for polling of an Azure Sphere catalog. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CatalogInner> beginCreateOrUpdateAsync( - String resourceGroupName, String catalogName, CatalogInner resource, Context context) { + private PollerFlux, CatalogInner> beginCreateOrUpdateAsync(String resourceGroupName, + String catalogName, CatalogInner resource, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, catalogName, resource, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), CatalogInner.class, CatalogInner.class, context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CatalogInner.class, CatalogInner.class, context); } /** * Create a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param resource Resource create parameters. @@ -922,14 +742,14 @@ private PollerFlux, CatalogInner> beginCreateOrUpdateAs * @return the {@link SyncPoller} for polling of an Azure Sphere catalog. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CatalogInner> beginCreateOrUpdate( - String resourceGroupName, String catalogName, CatalogInner resource) { + public SyncPoller, CatalogInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, CatalogInner resource) { return this.beginCreateOrUpdateAsync(resourceGroupName, catalogName, resource).getSyncPoller(); } /** * Create a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param resource Resource create parameters. @@ -940,14 +760,14 @@ public SyncPoller, CatalogInner> beginCreateOrUpdate( * @return the {@link SyncPoller} for polling of an Azure Sphere catalog. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CatalogInner> beginCreateOrUpdate( - String resourceGroupName, String catalogName, CatalogInner resource, Context context) { + public SyncPoller, CatalogInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, CatalogInner resource, Context context) { return this.beginCreateOrUpdateAsync(resourceGroupName, catalogName, resource, context).getSyncPoller(); } /** * Create a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param resource Resource create parameters. @@ -957,16 +777,15 @@ public SyncPoller, CatalogInner> beginCreateOrUpdate( * @return an Azure Sphere catalog on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String catalogName, CatalogInner resource) { - return beginCreateOrUpdateAsync(resourceGroupName, catalogName, resource) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, + CatalogInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, catalogName, resource).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param resource Resource create parameters. @@ -977,16 +796,15 @@ private Mono createOrUpdateAsync( * @return an Azure Sphere catalog on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String catalogName, CatalogInner resource, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, catalogName, resource, context) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, CatalogInner resource, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, catalogName, resource, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param resource Resource create parameters. @@ -1002,7 +820,7 @@ public CatalogInner createOrUpdate(String resourceGroupName, String catalogName, /** * Create a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param resource Resource create parameters. @@ -1013,14 +831,14 @@ public CatalogInner createOrUpdate(String resourceGroupName, String catalogName, * @return an Azure Sphere catalog. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CatalogInner createOrUpdate( - String resourceGroupName, String catalogName, CatalogInner resource, Context context) { + public CatalogInner createOrUpdate(String resourceGroupName, String catalogName, CatalogInner resource, + Context context) { return createOrUpdateAsync(resourceGroupName, catalogName, resource, context).block(); } /** * Update a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param properties The resource properties to be updated. @@ -1030,19 +848,15 @@ public CatalogInner createOrUpdate( * @return an Azure Sphere catalog along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String catalogName, CatalogUpdate properties) { + private Mono> updateWithResponseAsync(String resourceGroupName, String catalogName, + CatalogUpdate properties) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1058,24 +872,14 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - properties, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, properties, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param properties The resource properties to be updated. @@ -1086,19 +890,15 @@ private Mono> updateWithResponseAsync( * @return an Azure Sphere catalog along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String catalogName, CatalogUpdate properties, Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, String catalogName, + CatalogUpdate properties, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1114,21 +914,13 @@ private Mono> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - properties, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, properties, accept, context); } /** * Update a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param properties The resource properties to be updated. @@ -1145,7 +937,7 @@ private Mono updateAsync(String resourceGroupName, String catalogN /** * Update a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param properties The resource properties to be updated. @@ -1156,14 +948,14 @@ private Mono updateAsync(String resourceGroupName, String catalogN * @return an Azure Sphere catalog along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String catalogName, CatalogUpdate properties, Context context) { + public Response updateWithResponse(String resourceGroupName, String catalogName, + CatalogUpdate properties, Context context) { return updateWithResponseAsync(resourceGroupName, catalogName, properties, context).block(); } /** * Update a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param properties The resource properties to be updated. @@ -1179,7 +971,7 @@ public CatalogInner update(String resourceGroupName, String catalogName, Catalog /** * Delete a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1190,16 +982,12 @@ public CatalogInner update(String resourceGroupName, String catalogName, Catalog @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1210,23 +998,14 @@ private Mono>> deleteWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -1236,19 +1015,15 @@ private Mono>> deleteWithResponseAsync(String resource * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String catalogName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1259,20 +1034,13 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, accept, context); } /** * Delete a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1283,15 +1051,13 @@ private Mono>> deleteWithResponseAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, catalogName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Delete a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -1301,18 +1067,17 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String catalogName, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, + Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, catalogName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Delete a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1327,7 +1092,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Delete a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -1337,14 +1102,14 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String catalogName, Context context) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + Context context) { return this.beginDeleteAsync(resourceGroupName, catalogName, context).getSyncPoller(); } /** * Delete a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1359,7 +1124,7 @@ private Mono deleteAsync(String resourceGroupName, String catalogName) { /** * Delete a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -1370,14 +1135,13 @@ private Mono deleteAsync(String resourceGroupName, String catalogName) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String catalogName, Context context) { - return beginDeleteAsync(resourceGroupName, catalogName, context) - .last() + return beginDeleteAsync(resourceGroupName, catalogName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1391,7 +1155,7 @@ public void delete(String resourceGroupName, String catalogName) { /** * Delete a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -1406,29 +1170,25 @@ public void delete(String resourceGroupName, String catalogName, Context context /** * Counts devices in catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response to the action call for count devices in a catalog along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> countDevicesWithResponseAsync( - String resourceGroupName, String catalogName) { + private Mono> countDevicesWithResponseAsync(String resourceGroupName, + String catalogName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1439,23 +1199,14 @@ private Mono> countDevicesWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .countDevices( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - accept, - context)) + .withContext(context -> service.countDevices(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Counts devices in catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -1463,22 +1214,18 @@ private Mono> countDevicesWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response to the action call for count devices in a catalog along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> countDevicesWithResponseAsync( - String resourceGroupName, String catalogName, Context context) { + private Mono> countDevicesWithResponseAsync(String resourceGroupName, + String catalogName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1489,20 +1236,13 @@ private Mono> countDevicesWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .countDevices( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - accept, - context); + return service.countDevices(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, accept, context); } /** * Counts devices in catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1511,14 +1251,14 @@ private Mono> countDevicesWithResponseAsync( * @return response to the action call for count devices in a catalog on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono countDevicesAsync(String resourceGroupName, String catalogName) { + private Mono countDevicesAsync(String resourceGroupName, String catalogName) { return countDevicesWithResponseAsync(resourceGroupName, catalogName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Counts devices in catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -1528,14 +1268,14 @@ private Mono countDevicesAsync(String resourceGroupNam * @return response to the action call for count devices in a catalog along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response countDevicesWithResponse( - String resourceGroupName, String catalogName, Context context) { + public Response countDevicesWithResponse(String resourceGroupName, String catalogName, + Context context) { return countDevicesWithResponseAsync(resourceGroupName, catalogName, context).block(); } /** * Counts devices in catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1544,13 +1284,13 @@ public Response countDevicesWithResponse( * @return response to the action call for count devices in a catalog. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CountDeviceResponseInner countDevices(String resourceGroupName, String catalogName) { + public CountDevicesResponseInner countDevices(String resourceGroupName, String catalogName) { return countDevicesWithResponse(resourceGroupName, catalogName, Context.NONE).getValue(); } /** * Lists deployments for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -1561,22 +1301,18 @@ public CountDeviceResponseInner countDevices(String resourceGroupName, String ca * @throws ManagementException thrown 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 a Deployment list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeploymentsSinglePageAsync( - String resourceGroupName, String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize) { + private Mono> listDeploymentsSinglePageAsync(String resourceGroupName, + String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1587,36 +1323,17 @@ private Mono> listDeploymentsSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listDeployments( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - filter, - top, - skip, - maxpagesize, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listDeployments(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, accept, + context)) + .>map(res -> new 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 deployments for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -1628,28 +1345,18 @@ private Mono> listDeploymentsSinglePageAsync( * @throws ManagementException thrown 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 a Deployment list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeploymentsSinglePageAsync( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { + private Mono> listDeploymentsSinglePageAsync(String resourceGroupName, + String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1661,32 +1368,15 @@ private Mono> listDeploymentsSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listDeployments( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - filter, - top, - skip, - maxpagesize, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listDeployments(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, filter, top, skip, maxpagesize, catalogName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists deployments for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -1699,8 +1389,8 @@ private Mono> listDeploymentsSinglePageAsync( * @return the response of a Deployment list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDeploymentsAsync( - String resourceGroupName, String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize) { + private PagedFlux listDeploymentsAsync(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize) { return new PagedFlux<>( () -> listDeploymentsSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize), nextLink -> listDeploymentsNextSinglePageAsync(nextLink)); @@ -1708,7 +1398,7 @@ private PagedFlux listDeploymentsAsync( /** * Lists deployments for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1729,7 +1419,7 @@ private PagedFlux listDeploymentsAsync(String resourceGroupName /** * Lists deployments for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -1743,23 +1433,15 @@ private PagedFlux listDeploymentsAsync(String resourceGroupName * @return the response of a Deployment list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDeploymentsAsync( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { - return new PagedFlux<>( - () -> - listDeploymentsSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context), - nextLink -> listDeploymentsNextSinglePageAsync(nextLink, context)); + private PagedFlux listDeploymentsAsync(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context) { + return new PagedFlux<>(() -> listDeploymentsSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, + maxpagesize, context), nextLink -> listDeploymentsNextSinglePageAsync(nextLink, context)); } /** * Lists deployments for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1779,7 +1461,7 @@ public PagedIterable listDeployments(String resourceGroupName, /** * Lists deployments for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -1793,21 +1475,15 @@ public PagedIterable listDeployments(String resourceGroupName, * @return the response of a Deployment list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeployments( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { + public PagedIterable listDeployments(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context) { return new PagedIterable<>( listDeploymentsAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context)); } /** * List the device groups for the catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param listDeviceGroupsRequest List device groups for catalog. @@ -1819,28 +1495,19 @@ public PagedIterable listDeployments( * @throws ManagementException thrown 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 a DeviceGroup list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeviceGroupsSinglePageAsync( - String resourceGroupName, - String catalogName, - ListDeviceGroupsRequest listDeviceGroupsRequest, - String filter, - Integer top, - Integer skip, + private Mono> listDeviceGroupsSinglePageAsync(String resourceGroupName, + String catalogName, ListDeviceGroupsRequest listDeviceGroupsRequest, String filter, Integer top, Integer skip, Integer maxpagesize) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1850,45 +1517,24 @@ private Mono> listDeviceGroupsSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); } if (listDeviceGroupsRequest == null) { - return Mono - .error( - new IllegalArgumentException("Parameter listDeviceGroupsRequest is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter listDeviceGroupsRequest is required and cannot be null.")); } else { listDeviceGroupsRequest.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listDeviceGroups( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - filter, - top, - skip, - maxpagesize, - listDeviceGroupsRequest, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listDeviceGroups(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, + listDeviceGroupsRequest, accept, context)) + .>map(res -> new 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 device groups for the catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param listDeviceGroupsRequest List device groups for catalog. @@ -1901,29 +1547,19 @@ private Mono> listDeviceGroupsSinglePageAsync( * @throws ManagementException thrown 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 a DeviceGroup list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeviceGroupsSinglePageAsync( - String resourceGroupName, - String catalogName, - ListDeviceGroupsRequest listDeviceGroupsRequest, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { + private Mono> listDeviceGroupsSinglePageAsync(String resourceGroupName, + String catalogName, ListDeviceGroupsRequest listDeviceGroupsRequest, String filter, Integer top, Integer skip, + Integer maxpagesize, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1933,42 +1569,24 @@ private Mono> listDeviceGroupsSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); } if (listDeviceGroupsRequest == null) { - return Mono - .error( - new IllegalArgumentException("Parameter listDeviceGroupsRequest is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter listDeviceGroupsRequest is required and cannot be null.")); } else { listDeviceGroupsRequest.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listDeviceGroups( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - filter, - top, - skip, - maxpagesize, - listDeviceGroupsRequest, - accept, + .listDeviceGroups(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, filter, top, skip, maxpagesize, catalogName, listDeviceGroupsRequest, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List the device groups for the catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param listDeviceGroupsRequest List device groups for catalog. @@ -1982,24 +1600,17 @@ private Mono> listDeviceGroupsSinglePageAsync( * @return the response of a DeviceGroup list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDeviceGroupsAsync( - String resourceGroupName, - String catalogName, - ListDeviceGroupsRequest listDeviceGroupsRequest, - String filter, - Integer top, - Integer skip, + private PagedFlux listDeviceGroupsAsync(String resourceGroupName, String catalogName, + ListDeviceGroupsRequest listDeviceGroupsRequest, String filter, Integer top, Integer skip, Integer maxpagesize) { - return new PagedFlux<>( - () -> - listDeviceGroupsSinglePageAsync( - resourceGroupName, catalogName, listDeviceGroupsRequest, filter, top, skip, maxpagesize), + return new PagedFlux<>(() -> listDeviceGroupsSinglePageAsync(resourceGroupName, catalogName, + listDeviceGroupsRequest, filter, top, skip, maxpagesize), nextLink -> listDeviceGroupsNextSinglePageAsync(nextLink)); } /** * List the device groups for the catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param listDeviceGroupsRequest List device groups for catalog. @@ -2009,22 +1620,20 @@ private PagedFlux listDeviceGroupsAsync( * @return the response of a DeviceGroup list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDeviceGroupsAsync( - String resourceGroupName, String catalogName, ListDeviceGroupsRequest listDeviceGroupsRequest) { + private PagedFlux listDeviceGroupsAsync(String resourceGroupName, String catalogName, + ListDeviceGroupsRequest listDeviceGroupsRequest) { final String filter = null; final Integer top = null; final Integer skip = null; final Integer maxpagesize = null; - return new PagedFlux<>( - () -> - listDeviceGroupsSinglePageAsync( - resourceGroupName, catalogName, listDeviceGroupsRequest, filter, top, skip, maxpagesize), + return new PagedFlux<>(() -> listDeviceGroupsSinglePageAsync(resourceGroupName, catalogName, + listDeviceGroupsRequest, filter, top, skip, maxpagesize), nextLink -> listDeviceGroupsNextSinglePageAsync(nextLink)); } /** * List the device groups for the catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param listDeviceGroupsRequest List device groups for catalog. @@ -2039,25 +1648,17 @@ private PagedFlux listDeviceGroupsAsync( * @return the response of a DeviceGroup list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDeviceGroupsAsync( - String resourceGroupName, - String catalogName, - ListDeviceGroupsRequest listDeviceGroupsRequest, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, + private PagedFlux listDeviceGroupsAsync(String resourceGroupName, String catalogName, + ListDeviceGroupsRequest listDeviceGroupsRequest, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { - return new PagedFlux<>( - () -> - listDeviceGroupsSinglePageAsync( - resourceGroupName, catalogName, listDeviceGroupsRequest, filter, top, skip, maxpagesize, context), + return new PagedFlux<>(() -> listDeviceGroupsSinglePageAsync(resourceGroupName, catalogName, + listDeviceGroupsRequest, filter, top, skip, maxpagesize, context), nextLink -> listDeviceGroupsNextSinglePageAsync(nextLink, context)); } /** * List the device groups for the catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param listDeviceGroupsRequest List device groups for catalog. @@ -2067,20 +1668,19 @@ private PagedFlux listDeviceGroupsAsync( * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeviceGroups( - String resourceGroupName, String catalogName, ListDeviceGroupsRequest listDeviceGroupsRequest) { + public PagedIterable listDeviceGroups(String resourceGroupName, String catalogName, + ListDeviceGroupsRequest listDeviceGroupsRequest) { final String filter = null; final Integer top = null; final Integer skip = null; final Integer maxpagesize = null; - return new PagedIterable<>( - listDeviceGroupsAsync( - resourceGroupName, catalogName, listDeviceGroupsRequest, filter, top, skip, maxpagesize)); + return new PagedIterable<>(listDeviceGroupsAsync(resourceGroupName, catalogName, listDeviceGroupsRequest, + filter, top, skip, maxpagesize)); } /** * List the device groups for the catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param listDeviceGroupsRequest List device groups for catalog. @@ -2095,23 +1695,16 @@ public PagedIterable listDeviceGroups( * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeviceGroups( - String resourceGroupName, - String catalogName, - ListDeviceGroupsRequest listDeviceGroupsRequest, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, + public PagedIterable listDeviceGroups(String resourceGroupName, String catalogName, + ListDeviceGroupsRequest listDeviceGroupsRequest, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { - return new PagedIterable<>( - listDeviceGroupsAsync( - resourceGroupName, catalogName, listDeviceGroupsRequest, filter, top, skip, maxpagesize, context)); + return new PagedIterable<>(listDeviceGroupsAsync(resourceGroupName, catalogName, listDeviceGroupsRequest, + filter, top, skip, maxpagesize, context)); } /** * Lists device insights for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -2122,22 +1715,18 @@ public PagedIterable listDeviceGroups( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return paged collection of DeviceInsight items along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeviceInsightsSinglePageAsync( - String resourceGroupName, String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize) { + private Mono> listDeviceInsightsSinglePageAsync(String resourceGroupName, + String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2148,36 +1737,17 @@ private Mono> listDeviceInsightsSinglePageAsyn } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listDeviceInsights( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - filter, - top, - skip, - maxpagesize, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listDeviceInsights(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, accept, + context)) + .>map(res -> new 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 device insights for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -2189,28 +1759,18 @@ private Mono> listDeviceInsightsSinglePageAsyn * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return paged collection of DeviceInsight items along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeviceInsightsSinglePageAsync( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { + private Mono> listDeviceInsightsSinglePageAsync(String resourceGroupName, + String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2222,32 +1782,15 @@ private Mono> listDeviceInsightsSinglePageAsyn final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listDeviceInsights( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - filter, - top, - skip, - maxpagesize, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listDeviceInsights(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, filter, top, skip, maxpagesize, catalogName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists device insights for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -2260,8 +1803,8 @@ private Mono> listDeviceInsightsSinglePageAsyn * @return paged collection of DeviceInsight items as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDeviceInsightsAsync( - String resourceGroupName, String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize) { + private PagedFlux listDeviceInsightsAsync(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize) { return new PagedFlux<>( () -> listDeviceInsightsSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize), nextLink -> listDeviceInsightsNextSinglePageAsync(nextLink)); @@ -2269,7 +1812,7 @@ private PagedFlux listDeviceInsightsAsync( /** * Lists device insights for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2290,7 +1833,7 @@ private PagedFlux listDeviceInsightsAsync(String resourceGro /** * Lists device insights for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -2304,24 +1847,15 @@ private PagedFlux listDeviceInsightsAsync(String resourceGro * @return paged collection of DeviceInsight items as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDeviceInsightsAsync( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { - return new PagedFlux<>( - () -> - listDeviceInsightsSinglePageAsync( - resourceGroupName, catalogName, filter, top, skip, maxpagesize, context), - nextLink -> listDeviceInsightsNextSinglePageAsync(nextLink, context)); + private PagedFlux listDeviceInsightsAsync(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { + return new PagedFlux<>(() -> listDeviceInsightsSinglePageAsync(resourceGroupName, catalogName, filter, top, + skip, maxpagesize, context), nextLink -> listDeviceInsightsNextSinglePageAsync(nextLink, context)); } /** * Lists device insights for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2341,7 +1875,7 @@ public PagedIterable listDeviceInsights(String resourceGroup /** * Lists device insights for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -2355,21 +1889,15 @@ public PagedIterable listDeviceInsights(String resourceGroup * @return paged collection of DeviceInsight items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDeviceInsights( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { + public PagedIterable listDeviceInsights(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { return new PagedIterable<>( listDeviceInsightsAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context)); } /** * Lists devices for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -2380,22 +1908,18 @@ public PagedIterable listDeviceInsights( * @throws ManagementException thrown 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 a Device list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDevicesSinglePageAsync( - String resourceGroupName, String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize) { + private Mono> listDevicesSinglePageAsync(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2406,36 +1930,17 @@ private Mono> listDevicesSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listDevices( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - filter, - top, - skip, - maxpagesize, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listDevices(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, accept, + context)) + .>map(res -> new 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 devices for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -2447,28 +1952,18 @@ private Mono> listDevicesSinglePageAsync( * @throws ManagementException thrown 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 a Device list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDevicesSinglePageAsync( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { + private Mono> listDevicesSinglePageAsync(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2480,32 +1975,15 @@ private Mono> listDevicesSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listDevices( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - filter, - top, - skip, - maxpagesize, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listDevices(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, filter, top, skip, maxpagesize, catalogName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists devices for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -2518,8 +1996,8 @@ private Mono> listDevicesSinglePageAsync( * @return the response of a Device list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDevicesAsync( - String resourceGroupName, String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize) { + private PagedFlux listDevicesAsync(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize) { return new PagedFlux<>( () -> listDevicesSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize), nextLink -> listDevicesNextSinglePageAsync(nextLink)); @@ -2527,7 +2005,7 @@ private PagedFlux listDevicesAsync( /** * Lists devices for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2548,7 +2026,7 @@ private PagedFlux listDevicesAsync(String resourceGroupName, String /** * Lists devices for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -2562,14 +2040,8 @@ private PagedFlux listDevicesAsync(String resourceGroupName, String * @return the response of a Device list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listDevicesAsync( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { + private PagedFlux listDevicesAsync(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context) { return new PagedFlux<>( () -> listDevicesSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context), nextLink -> listDevicesNextSinglePageAsync(nextLink, context)); @@ -2577,7 +2049,7 @@ private PagedFlux listDevicesAsync( /** * Lists devices for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2596,7 +2068,7 @@ public PagedIterable listDevices(String resourceGroupName, String c /** * Lists devices for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -2610,28 +2082,252 @@ public PagedIterable listDevices(String resourceGroupName, String c * @return the response of a Device list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listDevices( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { + public PagedIterable listDevices(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context) { return new PagedIterable<>( listDevicesAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context)); } + /** + * Creates an image. Use this action when the image ID is unknown. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param uploadImageRequest Image upload 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> uploadImageWithResponseAsync(String resourceGroupName, String catalogName, + ImageInner uploadImageRequest) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (uploadImageRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter uploadImageRequest is required and cannot be null.")); + } else { + uploadImageRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.uploadImage(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, uploadImageRequest, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates an image. Use this action when the image ID is unknown. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param uploadImageRequest Image upload 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 the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> uploadImageWithResponseAsync(String resourceGroupName, String catalogName, + ImageInner uploadImageRequest, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (catalogName == null) { + return Mono.error(new IllegalArgumentException("Parameter catalogName is required and cannot be null.")); + } + if (uploadImageRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter uploadImageRequest is required and cannot be null.")); + } else { + uploadImageRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.uploadImage(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, uploadImageRequest, accept, context); + } + + /** + * Creates an image. Use this action when the image ID is unknown. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param uploadImageRequest Image upload 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUploadImageAsync(String resourceGroupName, String catalogName, + ImageInner uploadImageRequest) { + Mono>> mono + = uploadImageWithResponseAsync(resourceGroupName, catalogName, uploadImageRequest); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Creates an image. Use this action when the image ID is unknown. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param uploadImageRequest Image upload 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 the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginUploadImageAsync(String resourceGroupName, String catalogName, + ImageInner uploadImageRequest, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = uploadImageWithResponseAsync(resourceGroupName, catalogName, uploadImageRequest, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Creates an image. Use this action when the image ID is unknown. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param uploadImageRequest Image upload 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUploadImage(String resourceGroupName, String catalogName, + ImageInner uploadImageRequest) { + return this.beginUploadImageAsync(resourceGroupName, catalogName, uploadImageRequest).getSyncPoller(); + } + + /** + * Creates an image. Use this action when the image ID is unknown. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param uploadImageRequest Image upload 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 the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginUploadImage(String resourceGroupName, String catalogName, + ImageInner uploadImageRequest, Context context) { + return this.beginUploadImageAsync(resourceGroupName, catalogName, uploadImageRequest, context).getSyncPoller(); + } + + /** + * Creates an image. Use this action when the image ID is unknown. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param uploadImageRequest Image upload 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono uploadImageAsync(String resourceGroupName, String catalogName, ImageInner uploadImageRequest) { + return beginUploadImageAsync(resourceGroupName, catalogName, uploadImageRequest).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an image. Use this action when the image ID is unknown. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param uploadImageRequest Image upload 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono uploadImageAsync(String resourceGroupName, String catalogName, ImageInner uploadImageRequest, + Context context) { + return beginUploadImageAsync(resourceGroupName, catalogName, uploadImageRequest, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates an image. Use this action when the image ID is unknown. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param uploadImageRequest Image upload 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void uploadImage(String resourceGroupName, String catalogName, ImageInner uploadImageRequest) { + uploadImageAsync(resourceGroupName, catalogName, uploadImageRequest).block(); + } + + /** + * Creates an image. Use this action when the image ID is unknown. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param uploadImageRequest Image upload 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void uploadImage(String resourceGroupName, String catalogName, ImageInner uploadImageRequest, + Context context) { + uploadImageAsync(resourceGroupName, catalogName, uploadImageRequest, context).block(); + } + /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 a Catalog list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -2639,38 +2335,30 @@ private Mono> listBySubscriptionNextSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return 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)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 a Catalog list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { @@ -2678,36 +2366,27 @@ private Mono> listBySubscriptionNextSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + 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)); + 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 URL to get the next list of items - *

The nextLink parameter. + * + * 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 a Catalog list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -2715,38 +2394,30 @@ private Mono> listByResourceGroupNextSinglePageAsync return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return 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)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 a Catalog list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { @@ -2754,36 +2425,27 @@ private Mono> listByResourceGroupNextSinglePageAsync return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + 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)); + 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 URL to get the next list of items - *

The nextLink parameter. + * + * 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 a Deployment list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsNextSinglePageAsync(String nextLink) { @@ -2791,37 +2453,29 @@ private Mono> listDeploymentsNextSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return 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)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 a Deployment list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeploymentsNextSinglePageAsync(String nextLink, Context context) { @@ -2829,36 +2483,27 @@ private Mono> listDeploymentsNextSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + 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)); + 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 URL to get the next list of items - *

The nextLink parameter. + * + * 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 a DeviceGroup list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeviceGroupsNextSinglePageAsync(String nextLink) { @@ -2866,75 +2511,58 @@ private Mono> listDeviceGroupsNextSinglePageAsyn return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listDeviceGroupsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 a DeviceGroup list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeviceGroupsNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listDeviceGroupsNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listDeviceGroupsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listDeviceGroupsNext(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 URL to get the next list of items - *

The nextLink parameter. + * + * 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 paged collection of DeviceInsight items along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDeviceInsightsNextSinglePageAsync(String nextLink) { @@ -2942,76 +2570,59 @@ private Mono> listDeviceInsightsNextSinglePage return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listDeviceInsightsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 paged collection of DeviceInsight items along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listDeviceInsightsNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listDeviceInsightsNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listDeviceInsightsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listDeviceInsightsNext(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 URL to get the next list of items - *

The nextLink parameter. + * + * 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 a Device list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDevicesNextSinglePageAsync(String nextLink) { @@ -3019,37 +2630,29 @@ private Mono> listDevicesNextSinglePageAsync(String n return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listDevicesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 a Device list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDevicesNextSinglePageAsync(String nextLink, Context context) { @@ -3057,23 +2660,13 @@ private Mono> listDevicesNextSinglePageAsync(String n return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listDevicesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listDevicesNext(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/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogsImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogsImpl.java index 7204f29b10d98..69ae4fb4568f3 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogsImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CatalogsImpl.java @@ -11,14 +11,15 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.sphere.fluent.CatalogsClient; import com.azure.resourcemanager.sphere.fluent.models.CatalogInner; -import com.azure.resourcemanager.sphere.fluent.models.CountDeviceResponseInner; +import com.azure.resourcemanager.sphere.fluent.models.CountDevicesResponseInner; import com.azure.resourcemanager.sphere.fluent.models.DeploymentInner; import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner; import com.azure.resourcemanager.sphere.fluent.models.DeviceInner; import com.azure.resourcemanager.sphere.fluent.models.DeviceInsightInner; +import com.azure.resourcemanager.sphere.fluent.models.ImageInner; import com.azure.resourcemanager.sphere.models.Catalog; import com.azure.resourcemanager.sphere.models.Catalogs; -import com.azure.resourcemanager.sphere.models.CountDeviceResponse; +import com.azure.resourcemanager.sphere.models.CountDevicesResponse; import com.azure.resourcemanager.sphere.models.Deployment; import com.azure.resourcemanager.sphere.models.Device; import com.azure.resourcemanager.sphere.models.DeviceGroup; @@ -32,41 +33,38 @@ public final class CatalogsImpl implements Catalogs { private final com.azure.resourcemanager.sphere.AzureSphereManager serviceManager; - public CatalogsImpl( - CatalogsClient innerClient, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { + public CatalogsImpl(CatalogsClient innerClient, + com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new CatalogImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CatalogImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new CatalogImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CatalogImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new CatalogImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CatalogImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new CatalogImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CatalogImpl(inner1, this.manager())); } - public Response getByResourceGroupWithResponse( - String resourceGroupName, String catalogName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, catalogName, context); + public Response getByResourceGroupWithResponse(String resourceGroupName, String catalogName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, catalogName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new CatalogImpl(inner.getValue(), this.manager())); } else { return null; @@ -90,25 +88,22 @@ public void delete(String resourceGroupName, String catalogName, Context context this.serviceClient().delete(resourceGroupName, catalogName, context); } - public Response countDevicesWithResponse( - String resourceGroupName, String catalogName, Context context) { - Response inner = - this.serviceClient().countDevicesWithResponse(resourceGroupName, catalogName, context); + public Response countDevicesWithResponse(String resourceGroupName, String catalogName, + Context context) { + Response inner + = this.serviceClient().countDevicesWithResponse(resourceGroupName, catalogName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new CountDeviceResponseImpl(inner.getValue(), this.manager())); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CountDevicesResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public CountDeviceResponse countDevices(String resourceGroupName, String catalogName) { - CountDeviceResponseInner inner = this.serviceClient().countDevices(resourceGroupName, catalogName); + public CountDevicesResponse countDevices(String resourceGroupName, String catalogName) { + CountDevicesResponseInner inner = this.serviceClient().countDevices(resourceGroupName, catalogName); if (inner != null) { - return new CountDeviceResponseImpl(inner, this.manager()); + return new CountDevicesResponseImpl(inner, this.manager()); } else { return null; } @@ -116,159 +111,117 @@ public CountDeviceResponse countDevices(String resourceGroupName, String catalog public PagedIterable listDeployments(String resourceGroupName, String catalogName) { PagedIterable inner = this.serviceClient().listDeployments(resourceGroupName, catalogName); - return Utils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager())); } - public PagedIterable listDeployments( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { - PagedIterable inner = - this - .serviceClient() - .listDeployments(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context); - return Utils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager())); + public PagedIterable listDeployments(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context) { + PagedIterable inner = this.serviceClient().listDeployments(resourceGroupName, catalogName, + filter, top, skip, maxpagesize, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager())); } - public PagedIterable listDeviceGroups( - String resourceGroupName, String catalogName, ListDeviceGroupsRequest listDeviceGroupsRequest) { - PagedIterable inner = - this.serviceClient().listDeviceGroups(resourceGroupName, catalogName, listDeviceGroupsRequest); - return Utils.mapPage(inner, inner1 -> new DeviceGroupImpl(inner1, this.manager())); + public PagedIterable listDeviceGroups(String resourceGroupName, String catalogName, + ListDeviceGroupsRequest listDeviceGroupsRequest) { + PagedIterable inner + = this.serviceClient().listDeviceGroups(resourceGroupName, catalogName, listDeviceGroupsRequest); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceGroupImpl(inner1, this.manager())); } - public PagedIterable listDeviceGroups( - String resourceGroupName, - String catalogName, - ListDeviceGroupsRequest listDeviceGroupsRequest, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, + public PagedIterable listDeviceGroups(String resourceGroupName, String catalogName, + ListDeviceGroupsRequest listDeviceGroupsRequest, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { - PagedIterable inner = - this - .serviceClient() - .listDeviceGroups( - resourceGroupName, catalogName, listDeviceGroupsRequest, filter, top, skip, maxpagesize, context); - return Utils.mapPage(inner, inner1 -> new DeviceGroupImpl(inner1, this.manager())); + PagedIterable inner = this.serviceClient().listDeviceGroups(resourceGroupName, catalogName, + listDeviceGroupsRequest, filter, top, skip, maxpagesize, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceGroupImpl(inner1, this.manager())); } public PagedIterable listDeviceInsights(String resourceGroupName, String catalogName) { - PagedIterable inner = - this.serviceClient().listDeviceInsights(resourceGroupName, catalogName); - return Utils.mapPage(inner, inner1 -> new DeviceInsightImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listDeviceInsights(resourceGroupName, catalogName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceInsightImpl(inner1, this.manager())); } - public PagedIterable listDeviceInsights( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { - PagedIterable inner = - this - .serviceClient() - .listDeviceInsights(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context); - return Utils.mapPage(inner, inner1 -> new DeviceInsightImpl(inner1, this.manager())); + public PagedIterable listDeviceInsights(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context) { + PagedIterable inner = this.serviceClient().listDeviceInsights(resourceGroupName, + catalogName, filter, top, skip, maxpagesize, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceInsightImpl(inner1, this.manager())); } public PagedIterable listDevices(String resourceGroupName, String catalogName) { PagedIterable inner = this.serviceClient().listDevices(resourceGroupName, catalogName); - return Utils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); + } + + public PagedIterable listDevices(String resourceGroupName, String catalogName, String filter, Integer top, + Integer skip, Integer maxpagesize, Context context) { + PagedIterable inner + = this.serviceClient().listDevices(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); + } + + public void uploadImage(String resourceGroupName, String catalogName, ImageInner uploadImageRequest) { + this.serviceClient().uploadImage(resourceGroupName, catalogName, uploadImageRequest); } - public PagedIterable listDevices( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, + public void uploadImage(String resourceGroupName, String catalogName, ImageInner uploadImageRequest, Context context) { - PagedIterable inner = - this.serviceClient().listDevices(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context); - return Utils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); + this.serviceClient().uploadImage(resourceGroupName, catalogName, uploadImageRequest, context); } public Catalog getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, catalogName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } return this.getByResourceGroupWithResponse(resourceGroupName, catalogName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } this.delete(resourceGroupName, catalogName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } this.delete(resourceGroupName, catalogName, context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificateChainResponseImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificateChainResponseImpl.java index c4f161c524887..42b6500cfaf00 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificateChainResponseImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificateChainResponseImpl.java @@ -12,8 +12,8 @@ public final class CertificateChainResponseImpl implements CertificateChainRespo private final com.azure.resourcemanager.sphere.AzureSphereManager serviceManager; - CertificateChainResponseImpl( - CertificateChainResponseInner innerObject, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { + CertificateChainResponseImpl(CertificateChainResponseInner innerObject, + com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificateImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificateImpl.java index 89bed5e2be67d..91f8136a0edd8 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificateImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificateImpl.java @@ -7,9 +7,7 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.sphere.fluent.models.CertificateInner; import com.azure.resourcemanager.sphere.models.Certificate; -import com.azure.resourcemanager.sphere.models.CertificateStatus; -import com.azure.resourcemanager.sphere.models.ProvisioningState; -import java.time.OffsetDateTime; +import com.azure.resourcemanager.sphere.models.CertificateProperties; public final class CertificateImpl implements Certificate { private CertificateInner innerObject; @@ -33,36 +31,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String certificate() { - return this.innerModel().certificate(); - } - - public CertificateStatus status() { - return this.innerModel().status(); - } - - public String subject() { - return this.innerModel().subject(); + public CertificateProperties properties() { + return this.innerModel().properties(); } - public String thumbprint() { - return this.innerModel().thumbprint(); - } - - public OffsetDateTime expiryUtc() { - return this.innerModel().expiryUtc(); - } - - public OffsetDateTime notBeforeUtc() { - return this.innerModel().notBeforeUtc(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public CertificateInner innerModel() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificatesClientImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificatesClientImpl.java index 317dfa9c52f3e..0aef1cf556fa3 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificatesClientImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificatesClientImpl.java @@ -35,110 +35,91 @@ import com.azure.resourcemanager.sphere.models.ProofOfPossessionNonceRequest; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in CertificatesClient. */ +/** + * An instance of this class provides access to all the operations defined in CertificatesClient. + */ public final class CertificatesClientImpl implements CertificatesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final CertificatesService service; - /** The service client containing this operation class. */ - private final AzureSphereManagementClientImpl client; + /** + * The service client containing this operation class. + */ + private final AzureSphereMgmtClientImpl client; /** * Initializes an instance of CertificatesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - CertificatesClientImpl(AzureSphereManagementClientImpl client) { - this.service = - RestProxy.create(CertificatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + CertificatesClientImpl(AzureSphereMgmtClientImpl client) { + this.service + = RestProxy.create(CertificatesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureSphereManagementClientCertificates to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for AzureSphereMgmtClientCertificates to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "AzureSphereManagemen") + @ServiceInterface(name = "AzureSphereMgmtClien") public interface CertificatesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCatalog( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @QueryParam("$skip") Integer skip, - @QueryParam("$maxpagesize") Integer maxpagesize, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}") - @ExpectedResponses({200}) + Mono> listByCatalog(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}") + @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("catalogName") String catalogName, - @PathParam("serialNumber") String serialNumber, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}/retrieveCertChain") - @ExpectedResponses({200}) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("serialNumber") String serialNumber, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}/retrieveCertChain") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> retrieveCertChain( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @PathParam("serialNumber") String serialNumber, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}/retrieveProofOfPossessionNonce") - @ExpectedResponses({200}) + Mono> retrieveCertChain(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("serialNumber") String serialNumber, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}/retrieveProofOfPossessionNonce") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> retrieveProofOfPossessionNonce( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, @PathParam("serialNumber") String serialNumber, @BodyParam("application/json") ProofOfPossessionNonceRequest proofOfPossessionNonceRequest, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByCatalogNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List Certificate resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -149,22 +130,18 @@ Mono> listByCatalogNext( * @throws ManagementException thrown 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 a Certificate list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCatalogSinglePageAsync( - String resourceGroupName, String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize) { + private Mono> listByCatalogSinglePageAsync(String resourceGroupName, + String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -175,36 +152,17 @@ private Mono> listByCatalogSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByCatalog( - this.client.getEndpoint(), - filter, - top, - skip, - maxpagesize, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByCatalog(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, accept, + context)) + .>map(res -> new 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 Certificate resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -216,28 +174,18 @@ private Mono> listByCatalogSinglePageAsync( * @throws ManagementException thrown 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 a Certificate list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCatalogSinglePageAsync( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { + private Mono> listByCatalogSinglePageAsync(String resourceGroupName, + String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -249,32 +197,15 @@ private Mono> listByCatalogSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByCatalog( - this.client.getEndpoint(), - filter, - top, - skip, - maxpagesize, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByCatalog(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, filter, top, skip, maxpagesize, catalogName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List Certificate resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -287,8 +218,8 @@ private Mono> listByCatalogSinglePageAsync( * @return the response of a Certificate list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCatalogAsync( - String resourceGroupName, String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize) { + private PagedFlux listByCatalogAsync(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize) { return new PagedFlux<>( () -> listByCatalogSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize), nextLink -> listByCatalogNextSinglePageAsync(nextLink)); @@ -296,7 +227,7 @@ private PagedFlux listByCatalogAsync( /** * List Certificate resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -317,7 +248,7 @@ private PagedFlux listByCatalogAsync(String resourceGroupName, /** * List Certificate resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -331,14 +262,8 @@ private PagedFlux listByCatalogAsync(String resourceGroupName, * @return the response of a Certificate list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCatalogAsync( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { + private PagedFlux listByCatalogAsync(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context) { return new PagedFlux<>( () -> listByCatalogSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context), nextLink -> listByCatalogNextSinglePageAsync(nextLink, context)); @@ -346,7 +271,7 @@ private PagedFlux listByCatalogAsync( /** * List Certificate resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -365,7 +290,7 @@ public PagedIterable listByCatalog(String resourceGroupName, S /** * List Certificate resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -379,21 +304,15 @@ public PagedIterable listByCatalog(String resourceGroupName, S * @return the response of a Certificate list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCatalog( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { + public PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context) { return new PagedIterable<>( listByCatalogAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context)); } /** * Get a Certificate. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -403,19 +322,15 @@ public PagedIterable listByCatalog( * @return a Certificate along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String catalogName, String serialNumber) { + private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, + String serialNumber) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -429,24 +344,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - serialNumber, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, serialNumber, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a Certificate. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -457,19 +362,15 @@ private Mono> getWithResponseAsync( * @return a Certificate along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String catalogName, String serialNumber, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, + String serialNumber, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -483,21 +384,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - serialNumber, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, serialNumber, accept, context); } /** * Get a Certificate. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -514,7 +407,7 @@ private Mono getAsync(String resourceGroupName, String catalog /** * Get a Certificate. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -525,14 +418,14 @@ private Mono getAsync(String resourceGroupName, String catalog * @return a Certificate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String catalogName, String serialNumber, Context context) { + public Response getWithResponse(String resourceGroupName, String catalogName, String serialNumber, + Context context) { return getWithResponseAsync(resourceGroupName, catalogName, serialNumber, context).block(); } /** * Get a Certificate. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -548,7 +441,7 @@ public CertificateInner get(String resourceGroupName, String catalogName, String /** * Retrieves cert chain. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -558,19 +451,15 @@ public CertificateInner get(String resourceGroupName, String catalogName, String * @return the certificate chain response along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> retrieveCertChainWithResponseAsync( - String resourceGroupName, String catalogName, String serialNumber) { + private Mono> retrieveCertChainWithResponseAsync(String resourceGroupName, + String catalogName, String serialNumber) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -584,24 +473,14 @@ private Mono> retrieveCertChainWithRespo } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .retrieveCertChain( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - serialNumber, - accept, - context)) + .withContext(context -> service.retrieveCertChain(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, serialNumber, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Retrieves cert chain. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -612,19 +491,15 @@ private Mono> retrieveCertChainWithRespo * @return the certificate chain response along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> retrieveCertChainWithResponseAsync( - String resourceGroupName, String catalogName, String serialNumber, Context context) { + private Mono> retrieveCertChainWithResponseAsync(String resourceGroupName, + String catalogName, String serialNumber, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -638,21 +513,13 @@ private Mono> retrieveCertChainWithRespo } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .retrieveCertChain( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - serialNumber, - accept, - context); + return service.retrieveCertChain(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, serialNumber, accept, context); } /** * Retrieves cert chain. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -662,15 +529,15 @@ private Mono> retrieveCertChainWithRespo * @return the certificate chain response on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono retrieveCertChainAsync( - String resourceGroupName, String catalogName, String serialNumber) { + private Mono retrieveCertChainAsync(String resourceGroupName, String catalogName, + String serialNumber) { return retrieveCertChainWithResponseAsync(resourceGroupName, catalogName, serialNumber) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Retrieves cert chain. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -681,14 +548,14 @@ private Mono retrieveCertChainAsync( * @return the certificate chain response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response retrieveCertChainWithResponse( - String resourceGroupName, String catalogName, String serialNumber, Context context) { + public Response retrieveCertChainWithResponse(String resourceGroupName, + String catalogName, String serialNumber, Context context) { return retrieveCertChainWithResponseAsync(resourceGroupName, catalogName, serialNumber, context).block(); } /** * Retrieves cert chain. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -698,14 +565,14 @@ public Response retrieveCertChainWithResponse( * @return the certificate chain response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CertificateChainResponseInner retrieveCertChain( - String resourceGroupName, String catalogName, String serialNumber) { + public CertificateChainResponseInner retrieveCertChain(String resourceGroupName, String catalogName, + String serialNumber) { return retrieveCertChainWithResponse(resourceGroupName, catalogName, serialNumber, Context.NONE).getValue(); } /** * Gets the proof of possession nonce. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -717,21 +584,15 @@ public CertificateChainResponseInner retrieveCertChain( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> retrieveProofOfPossessionNonceWithResponseAsync( - String resourceGroupName, - String catalogName, - String serialNumber, + String resourceGroupName, String catalogName, String serialNumber, ProofOfPossessionNonceRequest proofOfPossessionNonceRequest) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -744,34 +605,22 @@ private Mono> retrieveProofOfPosse return Mono.error(new IllegalArgumentException("Parameter serialNumber is required and cannot be null.")); } if (proofOfPossessionNonceRequest == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter proofOfPossessionNonceRequest is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter proofOfPossessionNonceRequest is required and cannot be null.")); } else { proofOfPossessionNonceRequest.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .retrieveProofOfPossessionNonce( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - serialNumber, - proofOfPossessionNonceRequest, - accept, - context)) + .withContext(context -> service.retrieveProofOfPossessionNonce(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, catalogName, + serialNumber, proofOfPossessionNonceRequest, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the proof of possession nonce. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -784,22 +633,15 @@ private Mono> retrieveProofOfPosse */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> retrieveProofOfPossessionNonceWithResponseAsync( - String resourceGroupName, - String catalogName, - String serialNumber, - ProofOfPossessionNonceRequest proofOfPossessionNonceRequest, - Context context) { + String resourceGroupName, String catalogName, String serialNumber, + ProofOfPossessionNonceRequest proofOfPossessionNonceRequest, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -812,31 +654,21 @@ private Mono> retrieveProofOfPosse return Mono.error(new IllegalArgumentException("Parameter serialNumber is required and cannot be null.")); } if (proofOfPossessionNonceRequest == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter proofOfPossessionNonceRequest is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter proofOfPossessionNonceRequest is required and cannot be null.")); } else { proofOfPossessionNonceRequest.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .retrieveProofOfPossessionNonce( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - serialNumber, - proofOfPossessionNonceRequest, - accept, - context); + return service.retrieveProofOfPossessionNonce(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, serialNumber, + proofOfPossessionNonceRequest, accept, context); } /** * Gets the proof of possession nonce. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -847,19 +679,15 @@ private Mono> retrieveProofOfPosse * @return the proof of possession nonce on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono retrieveProofOfPossessionNonceAsync( - String resourceGroupName, - String catalogName, - String serialNumber, - ProofOfPossessionNonceRequest proofOfPossessionNonceRequest) { - return retrieveProofOfPossessionNonceWithResponseAsync( - resourceGroupName, catalogName, serialNumber, proofOfPossessionNonceRequest) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono retrieveProofOfPossessionNonceAsync(String resourceGroupName, + String catalogName, String serialNumber, ProofOfPossessionNonceRequest proofOfPossessionNonceRequest) { + return retrieveProofOfPossessionNonceWithResponseAsync(resourceGroupName, catalogName, serialNumber, + proofOfPossessionNonceRequest).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Gets the proof of possession nonce. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -872,19 +700,15 @@ private Mono retrieveProofOfPossessionNonce */ @ServiceMethod(returns = ReturnType.SINGLE) public Response retrieveProofOfPossessionNonceWithResponse( - String resourceGroupName, - String catalogName, - String serialNumber, - ProofOfPossessionNonceRequest proofOfPossessionNonceRequest, - Context context) { - return retrieveProofOfPossessionNonceWithResponseAsync( - resourceGroupName, catalogName, serialNumber, proofOfPossessionNonceRequest, context) - .block(); + String resourceGroupName, String catalogName, String serialNumber, + ProofOfPossessionNonceRequest proofOfPossessionNonceRequest, Context context) { + return retrieveProofOfPossessionNonceWithResponseAsync(resourceGroupName, catalogName, serialNumber, + proofOfPossessionNonceRequest, context).block(); } /** * Gets the proof of possession nonce. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -895,26 +719,23 @@ public Response retrieveProofOfPossessionNo * @return the proof of possession nonce. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ProofOfPossessionNonceResponseInner retrieveProofOfPossessionNonce( - String resourceGroupName, - String catalogName, - String serialNumber, - ProofOfPossessionNonceRequest proofOfPossessionNonceRequest) { - return retrieveProofOfPossessionNonceWithResponse( - resourceGroupName, catalogName, serialNumber, proofOfPossessionNonceRequest, Context.NONE) - .getValue(); + public ProofOfPossessionNonceResponseInner retrieveProofOfPossessionNonce(String resourceGroupName, + String catalogName, String serialNumber, ProofOfPossessionNonceRequest proofOfPossessionNonceRequest) { + return retrieveProofOfPossessionNonceWithResponse(resourceGroupName, catalogName, serialNumber, + proofOfPossessionNonceRequest, Context.NONE).getValue(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 a Certificate list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByCatalogNextSinglePageAsync(String nextLink) { @@ -922,37 +743,29 @@ private Mono> listByCatalogNextSinglePageAsync(S return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByCatalogNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 a Certificate list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByCatalogNextSinglePageAsync(String nextLink, Context context) { @@ -960,23 +773,13 @@ private Mono> listByCatalogNextSinglePageAsync(S return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByCatalogNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByCatalogNext(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/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificatesImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificatesImpl.java index d8edb696338e5..d0bfd69c21d81 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificatesImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CertificatesImpl.java @@ -26,39 +26,30 @@ public final class CertificatesImpl implements Certificates { private final com.azure.resourcemanager.sphere.AzureSphereManager serviceManager; - public CertificatesImpl( - CertificatesClient innerClient, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { + public CertificatesImpl(CertificatesClient innerClient, + com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable listByCatalog(String resourceGroupName, String catalogName) { PagedIterable inner = this.serviceClient().listByCatalog(resourceGroupName, catalogName); - return Utils.mapPage(inner, inner1 -> new CertificateImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CertificateImpl(inner1, this.manager())); } - public PagedIterable listByCatalog( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { - PagedIterable inner = - this.serviceClient().listByCatalog(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context); - return Utils.mapPage(inner, inner1 -> new CertificateImpl(inner1, this.manager())); + public PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context) { + PagedIterable inner = this.serviceClient().listByCatalog(resourceGroupName, catalogName, + filter, top, skip, maxpagesize, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CertificateImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, String catalogName, String serialNumber, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, catalogName, serialNumber, context); + public Response getWithResponse(String resourceGroupName, String catalogName, String serialNumber, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, catalogName, serialNumber, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new CertificateImpl(inner.getValue(), this.manager())); } else { return null; @@ -74,25 +65,22 @@ public Certificate get(String resourceGroupName, String catalogName, String seri } } - public Response retrieveCertChainWithResponse( - String resourceGroupName, String catalogName, String serialNumber, Context context) { - Response inner = - this.serviceClient().retrieveCertChainWithResponse(resourceGroupName, catalogName, serialNumber, context); + public Response retrieveCertChainWithResponse(String resourceGroupName, + String catalogName, String serialNumber, Context context) { + Response inner + = this.serviceClient().retrieveCertChainWithResponse(resourceGroupName, catalogName, serialNumber, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new CertificateChainResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public CertificateChainResponse retrieveCertChain( - String resourceGroupName, String catalogName, String serialNumber) { - CertificateChainResponseInner inner = - this.serviceClient().retrieveCertChain(resourceGroupName, catalogName, serialNumber); + public CertificateChainResponse retrieveCertChain(String resourceGroupName, String catalogName, + String serialNumber) { + CertificateChainResponseInner inner + = this.serviceClient().retrieveCertChain(resourceGroupName, catalogName, serialNumber); if (inner != null) { return new CertificateChainResponseImpl(inner, this.manager()); } else { @@ -100,38 +88,24 @@ public CertificateChainResponse retrieveCertChain( } } - public Response retrieveProofOfPossessionNonceWithResponse( - String resourceGroupName, - String catalogName, - String serialNumber, - ProofOfPossessionNonceRequest proofOfPossessionNonceRequest, + public Response retrieveProofOfPossessionNonceWithResponse(String resourceGroupName, + String catalogName, String serialNumber, ProofOfPossessionNonceRequest proofOfPossessionNonceRequest, Context context) { - Response inner = - this - .serviceClient() - .retrieveProofOfPossessionNonceWithResponse( - resourceGroupName, catalogName, serialNumber, proofOfPossessionNonceRequest, context); + Response inner + = this.serviceClient().retrieveProofOfPossessionNonceWithResponse(resourceGroupName, catalogName, + serialNumber, proofOfPossessionNonceRequest, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ProofOfPossessionNonceResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public ProofOfPossessionNonceResponse retrieveProofOfPossessionNonce( - String resourceGroupName, - String catalogName, - String serialNumber, - ProofOfPossessionNonceRequest proofOfPossessionNonceRequest) { - ProofOfPossessionNonceResponseInner inner = - this - .serviceClient() - .retrieveProofOfPossessionNonce( - resourceGroupName, catalogName, serialNumber, proofOfPossessionNonceRequest); + public ProofOfPossessionNonceResponse retrieveProofOfPossessionNonce(String resourceGroupName, String catalogName, + String serialNumber, ProofOfPossessionNonceRequest proofOfPossessionNonceRequest) { + ProofOfPossessionNonceResponseInner inner = this.serviceClient().retrieveProofOfPossessionNonce( + resourceGroupName, catalogName, serialNumber, proofOfPossessionNonceRequest); if (inner != null) { return new ProofOfPossessionNonceResponseImpl(inner, this.manager()); } else { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CountDeviceResponseImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CountDevicesResponseImpl.java similarity index 62% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CountDeviceResponseImpl.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CountDevicesResponseImpl.java index fb2b9e03cdc00..b27e7d871641f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CountDeviceResponseImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/CountDevicesResponseImpl.java @@ -4,16 +4,16 @@ package com.azure.resourcemanager.sphere.implementation; -import com.azure.resourcemanager.sphere.fluent.models.CountDeviceResponseInner; -import com.azure.resourcemanager.sphere.models.CountDeviceResponse; +import com.azure.resourcemanager.sphere.fluent.models.CountDevicesResponseInner; +import com.azure.resourcemanager.sphere.models.CountDevicesResponse; -public final class CountDeviceResponseImpl implements CountDeviceResponse { - private CountDeviceResponseInner innerObject; +public final class CountDevicesResponseImpl implements CountDevicesResponse { + private CountDevicesResponseInner innerObject; private final com.azure.resourcemanager.sphere.AzureSphereManager serviceManager; - CountDeviceResponseImpl( - CountDeviceResponseInner innerObject, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { + CountDevicesResponseImpl(CountDevicesResponseInner innerObject, + com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -22,7 +22,7 @@ public int value() { return this.innerModel().value(); } - public CountDeviceResponseInner innerModel() { + public CountDevicesResponseInner innerModel() { return this.innerObject; } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentImpl.java index 1f1923be9b2be..7a5c2b0f848eb 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentImpl.java @@ -4,16 +4,11 @@ package com.azure.resourcemanager.sphere.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.sphere.fluent.models.DeploymentInner; -import com.azure.resourcemanager.sphere.fluent.models.ImageInner; import com.azure.resourcemanager.sphere.models.Deployment; -import com.azure.resourcemanager.sphere.models.Image; -import com.azure.resourcemanager.sphere.models.ProvisioningState; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; +import com.azure.resourcemanager.sphere.models.DeploymentProperties; public final class DeploymentImpl implements Deployment, Deployment.Definition, Deployment.Update { private DeploymentInner innerObject; @@ -32,27 +27,12 @@ public String type() { return this.innerModel().type(); } - public String deploymentId() { - return this.innerModel().deploymentId(); + public DeploymentProperties properties() { + return this.innerModel().properties(); } - public List deployedImages() { - List inner = this.innerModel().deployedImages(); - if (inner != null) { - return Collections - .unmodifiableList( - inner.stream().map(inner1 -> new ImageImpl(inner1, this.manager())).collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public OffsetDateTime deploymentDateUtc() { - return this.innerModel().deploymentDateUtc(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -77,8 +57,8 @@ private com.azure.resourcemanager.sphere.AzureSphereManager manager() { private String deploymentName; - public DeploymentImpl withExistingDeviceGroup( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { + public DeploymentImpl withExistingDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName) { this.resourceGroupName = resourceGroupName; this.catalogName = catalogName; this.productName = productName; @@ -87,34 +67,14 @@ public DeploymentImpl withExistingDeviceGroup( } public Deployment create() { - this.innerObject = - serviceManager - .serviceClient() - .getDeployments() - .createOrUpdate( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deploymentName, - this.innerModel(), - Context.NONE); + this.innerObject = serviceManager.serviceClient().getDeployments().createOrUpdate(resourceGroupName, + catalogName, productName, deviceGroupName, deploymentName, this.innerModel(), Context.NONE); return this; } public Deployment create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDeployments() - .createOrUpdate( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deploymentName, - this.innerModel(), - context); + this.innerObject = serviceManager.serviceClient().getDeployments().createOrUpdate(resourceGroupName, + catalogName, productName, deviceGroupName, deploymentName, this.innerModel(), context); return this; } @@ -129,75 +89,43 @@ public DeploymentImpl update() { } public Deployment apply() { - this.innerObject = - serviceManager - .serviceClient() - .getDeployments() - .createOrUpdate( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deploymentName, - this.innerModel(), - Context.NONE); + this.innerObject = serviceManager.serviceClient().getDeployments().createOrUpdate(resourceGroupName, + catalogName, productName, deviceGroupName, deploymentName, this.innerModel(), Context.NONE); return this; } public Deployment apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDeployments() - .createOrUpdate( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deploymentName, - this.innerModel(), - context); + this.innerObject = serviceManager.serviceClient().getDeployments().createOrUpdate(resourceGroupName, + catalogName, productName, deviceGroupName, deploymentName, this.innerModel(), context); return this; } DeploymentImpl(DeploymentInner innerObject, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.catalogName = Utils.getValueFromIdByName(innerObject.id(), "catalogs"); - this.productName = Utils.getValueFromIdByName(innerObject.id(), "products"); - this.deviceGroupName = Utils.getValueFromIdByName(innerObject.id(), "deviceGroups"); - this.deploymentName = Utils.getValueFromIdByName(innerObject.id(), "deployments"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.catalogName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "catalogs"); + this.productName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "products"); + this.deviceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "deviceGroups"); + this.deploymentName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "deployments"); } public Deployment refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getDeployments() - .getWithResponse( - resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getDeployments() + .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, Context.NONE) + .getValue(); return this; } public Deployment refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDeployments() - .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context) - .getValue(); - return this; - } - - public DeploymentImpl withDeploymentId(String deploymentId) { - this.innerModel().withDeploymentId(deploymentId); + this.innerObject = serviceManager.serviceClient().getDeployments() + .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context) + .getValue(); return this; } - public DeploymentImpl withDeployedImages(List deployedImages) { - this.innerModel().withDeployedImages(deployedImages); + public DeploymentImpl withProperties(DeploymentProperties properties) { + this.innerModel().withProperties(properties); return this; } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentsClientImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentsClientImpl.java index 8e614c30d24c4..a1f267992d0f9 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentsClientImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentsClientImpl.java @@ -38,119 +38,94 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in DeploymentsClient. */ +/** + * An instance of this class provides access to all the operations defined in DeploymentsClient. + */ public final class DeploymentsClientImpl implements DeploymentsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final DeploymentsService service; - /** The service client containing this operation class. */ - private final AzureSphereManagementClientImpl client; + /** + * The service client containing this operation class. + */ + private final AzureSphereMgmtClientImpl client; /** * Initializes an instance of DeploymentsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - DeploymentsClientImpl(AzureSphereManagementClientImpl client) { - this.service = - RestProxy.create(DeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + DeploymentsClientImpl(AzureSphereMgmtClientImpl client) { + this.service + = RestProxy.create(DeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureSphereManagementClientDeployments to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for AzureSphereMgmtClientDeployments to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "AzureSphereManagemen") + @ServiceInterface(name = "AzureSphereMgmtClien") public interface DeploymentsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDeviceGroup( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @QueryParam("$skip") Integer skip, - @QueryParam("$maxpagesize") Integer maxpagesize, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @PathParam("productName") String productName, - @PathParam("deviceGroupName") String deviceGroupName, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByDeviceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}") + @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("catalogName") String catalogName, - @PathParam("productName") String productName, - @PathParam("deviceGroupName") String deviceGroupName, - @PathParam("deploymentName") String deploymentName, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}") + @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("catalogName") String catalogName, - @PathParam("productName") String productName, - @PathParam("deviceGroupName") String deviceGroupName, - @PathParam("deploymentName") String deploymentName, - @BodyParam("application/json") DeploymentInner resource, - @HeaderParam("Accept") String accept, - Context context); + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @PathParam("deploymentName") String deploymentName, @BodyParam("application/json") DeploymentInner resource, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}") + @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("catalogName") String catalogName, - @PathParam("productName") String productName, - @PathParam("deviceGroupName") String deviceGroupName, - @PathParam("deploymentName") String deploymentName, - @HeaderParam("Accept") String accept, - Context context); + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @PathParam("deploymentName") String deploymentName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByDeviceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be * used for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -163,29 +138,19 @@ Mono> listByDeviceGroupNext( * @throws ManagementException thrown 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 a Deployment list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDeviceGroupSinglePageAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String filter, - Integer top, - Integer skip, + private Mono> listByDeviceGroupSinglePageAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -203,39 +168,18 @@ private Mono> listByDeviceGroupSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByDeviceGroup( - this.client.getEndpoint(), - filter, - top, - skip, - maxpagesize, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByDeviceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, + productName, deviceGroupName, accept, context)) + .>map(res -> new 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 Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be * used for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -249,30 +193,19 @@ private Mono> listByDeviceGroupSinglePageAsync( * @throws ManagementException thrown 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 a Deployment list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDeviceGroupSinglePageAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { + private Mono> listByDeviceGroupSinglePageAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String filter, Integer top, Integer skip, + Integer maxpagesize, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -291,35 +224,17 @@ private Mono> listByDeviceGroupSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByDeviceGroup( - this.client.getEndpoint(), - filter, - top, - skip, - maxpagesize, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - accept, + .listByDeviceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, filter, top, skip, maxpagesize, catalogName, productName, deviceGroupName, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be * used for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -334,26 +249,17 @@ private Mono> listByDeviceGroupSinglePageAsync( * @return the response of a Deployment list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDeviceGroupAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize) { - return new PagedFlux<>( - () -> - listByDeviceGroupSinglePageAsync( - resourceGroupName, catalogName, productName, deviceGroupName, filter, top, skip, maxpagesize), + private PagedFlux listByDeviceGroupAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize) { + return new PagedFlux<>(() -> listByDeviceGroupSinglePageAsync(resourceGroupName, catalogName, productName, + deviceGroupName, filter, top, skip, maxpagesize), nextLink -> listByDeviceGroupNextSinglePageAsync(nextLink)); } /** * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be * used for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -364,23 +270,21 @@ private PagedFlux listByDeviceGroupAsync( * @return the response of a Deployment list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDeviceGroupAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { + private PagedFlux listByDeviceGroupAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName) { final String filter = null; final Integer top = null; final Integer skip = null; final Integer maxpagesize = null; - return new PagedFlux<>( - () -> - listByDeviceGroupSinglePageAsync( - resourceGroupName, catalogName, productName, deviceGroupName, filter, top, skip, maxpagesize), + return new PagedFlux<>(() -> listByDeviceGroupSinglePageAsync(resourceGroupName, catalogName, productName, + deviceGroupName, filter, top, skip, maxpagesize), nextLink -> listByDeviceGroupNextSinglePageAsync(nextLink)); } /** * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be * used for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -396,35 +300,18 @@ private PagedFlux listByDeviceGroupAsync( * @return the response of a Deployment list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDeviceGroupAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, + private PagedFlux listByDeviceGroupAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { - return new PagedFlux<>( - () -> - listByDeviceGroupSinglePageAsync( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - filter, - top, - skip, - maxpagesize, - context), + return new PagedFlux<>(() -> listByDeviceGroupSinglePageAsync(resourceGroupName, catalogName, productName, + deviceGroupName, filter, top, skip, maxpagesize, context), nextLink -> listByDeviceGroupNextSinglePageAsync(nextLink, context)); } /** * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be * used for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -435,21 +322,20 @@ private PagedFlux listByDeviceGroupAsync( * @return the response of a Deployment list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDeviceGroup( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { + public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, + String productName, String deviceGroupName) { final String filter = null; final Integer top = null; final Integer skip = null; final Integer maxpagesize = null; - return new PagedIterable<>( - listByDeviceGroupAsync( - resourceGroupName, catalogName, productName, deviceGroupName, filter, top, skip, maxpagesize)); + return new PagedIterable<>(listByDeviceGroupAsync(resourceGroupName, catalogName, productName, deviceGroupName, + filter, top, skip, maxpagesize)); } /** * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be * used for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -465,54 +351,38 @@ public PagedIterable listByDeviceGroup( * @return the response of a Deployment list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDeviceGroup( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, + public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { - return new PagedIterable<>( - listByDeviceGroupAsync( - resourceGroupName, catalogName, productName, deviceGroupName, filter, top, skip, maxpagesize, context)); + return new PagedIterable<>(listByDeviceGroupAsync(resourceGroupName, catalogName, productName, deviceGroupName, + filter, top, skip, maxpagesize, context)); } /** * Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device * group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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 Deployment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName) { + private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deploymentName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -533,33 +403,22 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deploymentName, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + deploymentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device * group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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. @@ -567,24 +426,15 @@ private Mono> getWithResponseAsync( * @return a Deployment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deploymentName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -605,42 +455,28 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deploymentName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, accept, context); } /** * Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device * group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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 Deployment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName) { + private Mono getAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName) { return getWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -648,13 +484,13 @@ private Mono getAsync( /** * Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device * group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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. @@ -662,81 +498,62 @@ private Mono getAsync( * @return a Deployment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - Context context) { - return getWithResponseAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context) - .block(); + public Response getWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName, Context context) { + return getWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, + context).block(); } /** * Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device * group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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 Deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentInner get( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, + public DeploymentInner get(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deploymentName) { - return getWithResponse( - resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, Context.NONE) - .getValue(); + return getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, + Context.NONE).getValue(); } /** * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device group. * @param resource Resource create 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 an deployment resource belonging to a device group resource along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deploymentName, DeploymentInner resource) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -762,62 +579,41 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deploymentName, - resource, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + deploymentName, resource, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device group. * @param resource Resource create 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 an deployment resource belonging to a device group resource along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - DeploymentInner resource, + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deploymentName, DeploymentInner resource, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -843,31 +639,21 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deploymentName, - resource, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + deploymentName, resource, accept, context); } /** * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device group. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -875,36 +661,25 @@ private Mono>> createOrUpdateWithResponseAsync( * @return the {@link PollerFlux} for polling of an deployment resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeploymentInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, + private PollerFlux, DeploymentInner> beginCreateOrUpdateAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deploymentName, DeploymentInner resource) { - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, resource); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeploymentInner.class, - DeploymentInner.class, - this.client.getContext()); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, + productName, deviceGroupName, deploymentName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DeploymentInner.class, DeploymentInner.class, this.client.getContext()); } /** * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device group. * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -913,34 +688,26 @@ private PollerFlux, DeploymentInner> beginCreateOrUp * @return the {@link PollerFlux} for polling of an deployment resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeploymentInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - DeploymentInner resource, + private PollerFlux, DeploymentInner> beginCreateOrUpdateAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deploymentName, DeploymentInner resource, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, resource, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DeploymentInner.class, DeploymentInner.class, context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, + productName, deviceGroupName, deploymentName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DeploymentInner.class, DeploymentInner.class, context); } /** * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device group. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -948,29 +715,23 @@ private PollerFlux, DeploymentInner> beginCreateOrUp * @return the {@link SyncPoller} for polling of an deployment resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentInner> beginCreateOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, + public SyncPoller, DeploymentInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deploymentName, DeploymentInner resource) { - return this - .beginCreateOrUpdateAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, resource) - .getSyncPoller(); + return this.beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, + deploymentName, resource).getSyncPoller(); } /** * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device group. * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -979,30 +740,23 @@ public SyncPoller, DeploymentInner> beginCreateOrUpd * @return the {@link SyncPoller} for polling of an deployment resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeploymentInner> beginCreateOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - DeploymentInner resource, + public SyncPoller, DeploymentInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deploymentName, DeploymentInner resource, Context context) { - return this - .beginCreateOrUpdateAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, resource, context) - .getSyncPoller(); + return this.beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, + deploymentName, resource, context).getSyncPoller(); } /** * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device group. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1010,29 +764,22 @@ public SyncPoller, DeploymentInner> beginCreateOrUpd * @return an deployment resource belonging to a device group resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - DeploymentInner resource) { - return beginCreateOrUpdateAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, resource) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName, DeploymentInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, + resource).last().flatMap(this.client::getLroFinalResultOrError); } /** * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device group. * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1041,30 +788,22 @@ private Mono createOrUpdateAsync( * @return an deployment resource belonging to a device group resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - DeploymentInner resource, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, resource, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName, DeploymentInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, + resource, context).last().flatMap(this.client::getLroFinalResultOrError); } /** * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device group. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1072,28 +811,22 @@ private Mono createOrUpdateAsync( * @return an deployment resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentInner createOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - DeploymentInner resource) { - return createOrUpdateAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, resource) - .block(); + public DeploymentInner createOrUpdate(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName, DeploymentInner resource) { + return createOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, + resource).block(); } /** * Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device group. * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1102,52 +835,37 @@ public DeploymentInner createOrUpdate( * @return an deployment resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeploymentInner createOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - DeploymentInner resource, - Context context) { - return createOrUpdateAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, resource, context) - .block(); + public DeploymentInner createOrUpdate(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName, DeploymentInner resource, Context context) { + return createOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, + resource, context).block(); } /** * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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 {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deploymentName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1168,33 +886,22 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deploymentName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + deploymentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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. @@ -1202,24 +909,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deploymentName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1240,60 +938,44 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deploymentName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, accept, context); } /** * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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 {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deploymentName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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. @@ -1301,59 +983,47 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deploymentName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, catalogName, productName, + deviceGroupName, deploymentName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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 {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName) { - return this - .beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName) + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deploymentName) { + return this.beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName) .getSyncPoller(); } /** * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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. @@ -1361,13 +1031,8 @@ public SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - Context context) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deploymentName, Context context) { return this .beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context) .getSyncPoller(); @@ -1376,40 +1041,35 @@ public SyncPoller, Void> beginDelete( /** * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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 {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName) { - return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName) - .last() + private Mono deleteAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName) { + return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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. @@ -1417,38 +1077,28 @@ private Mono deleteAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - Context context) { + private Mono deleteAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName, Context context) { return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + .last().flatMap(this.client::getLroFinalResultOrError); } /** * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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 catalogName, - String productName, - String deviceGroupName, + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deploymentName) { deleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName).block(); } @@ -1456,39 +1106,35 @@ public void delete( /** * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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 catalogName, - String productName, - String deviceGroupName, - String deploymentName, - Context context) { + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deploymentName, Context context) { deleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context).block(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 a Deployment list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByDeviceGroupNextSinglePageAsync(String nextLink) { @@ -1496,62 +1142,44 @@ private Mono> listByDeviceGroupNextSinglePageAsyn return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByDeviceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 a Deployment list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDeviceGroupNextSinglePageAsync( - String nextLink, Context context) { + private Mono> listByDeviceGroupNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByDeviceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByDeviceGroupNext(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/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentsImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentsImpl.java index eb743c5dd580b..8c7fadcc8dcf1 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentsImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeploymentsImpl.java @@ -21,75 +21,42 @@ public final class DeploymentsImpl implements Deployments { private final com.azure.resourcemanager.sphere.AzureSphereManager serviceManager; - public DeploymentsImpl( - DeploymentsClient innerClient, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { + public DeploymentsImpl(DeploymentsClient innerClient, + com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PagedIterable listByDeviceGroup( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { - PagedIterable inner = - this.serviceClient().listByDeviceGroup(resourceGroupName, catalogName, productName, deviceGroupName); - return Utils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager())); + public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName) { + PagedIterable inner + = this.serviceClient().listByDeviceGroup(resourceGroupName, catalogName, productName, deviceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager())); } - public PagedIterable listByDeviceGroup( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { - PagedIterable inner = - this - .serviceClient() - .listByDeviceGroup( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - filter, - top, - skip, - maxpagesize, - context); - return Utils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager())); + public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { + PagedIterable inner = this.serviceClient().listByDeviceGroup(resourceGroupName, catalogName, + productName, deviceGroupName, filter, top, skip, maxpagesize, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeploymentImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context); + public Response getWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, catalogName, + productName, deviceGroupName, deploymentName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new DeploymentImpl(inner.getValue(), this.manager())); } else { return null; } } - public Deployment get( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, + public Deployment get(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deploymentName) { - DeploymentInner inner = - this.serviceClient().get(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName); + DeploymentInner inner + = this.serviceClient().get(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName); if (inner != null) { return new DeploymentImpl(inner, this.manager()); } else { @@ -97,63 +64,42 @@ public Deployment get( } } - public void delete( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deploymentName) { this.serviceClient().delete(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName); } - public void delete( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - Context context) { - this - .serviceClient() - .delete(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context); + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deploymentName, Context context) { + this.serviceClient().delete(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, + context); } public Deployment getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String productName = Utils.getValueFromIdByName(id, "products"); + String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); if (productName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); } - String deviceGroupName = Utils.getValueFromIdByName(id, "deviceGroups"); + String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); if (deviceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); } - String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); if (deploymentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); } return this .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, Context.NONE) @@ -161,122 +107,89 @@ public Deployment getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String productName = Utils.getValueFromIdByName(id, "products"); + String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); if (productName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); } - String deviceGroupName = Utils.getValueFromIdByName(id, "deviceGroups"); + String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); if (deviceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); } - String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); if (deploymentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); } - return this - .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context); + return this.getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, + context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String productName = Utils.getValueFromIdByName(id, "products"); + String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); if (productName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); } - String deviceGroupName = Utils.getValueFromIdByName(id, "deviceGroups"); + String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); if (deviceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); } - String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); if (deploymentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); } this.delete(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String productName = Utils.getValueFromIdByName(id, "products"); + String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); if (productName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); } - String deviceGroupName = Utils.getValueFromIdByName(id, "deviceGroups"); + String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); if (deviceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); } - String deploymentName = Utils.getValueFromIdByName(id, "deployments"); + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "deployments"); if (deploymentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deployments'.", id))); } this.delete(resourceGroupName, catalogName, productName, deviceGroupName, deploymentName, context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupImpl.java index b62722fd63eeb..a2563e1f77859 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupImpl.java @@ -5,17 +5,15 @@ package com.azure.resourcemanager.sphere.implementation; import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner; -import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; import com.azure.resourcemanager.sphere.models.ClaimDevicesRequest; -import com.azure.resourcemanager.sphere.models.CountDeviceResponse; +import com.azure.resourcemanager.sphere.models.CountDevicesResponse; import com.azure.resourcemanager.sphere.models.DeviceGroup; +import com.azure.resourcemanager.sphere.models.DeviceGroupProperties; import com.azure.resourcemanager.sphere.models.DeviceGroupUpdate; -import com.azure.resourcemanager.sphere.models.OSFeedType; -import com.azure.resourcemanager.sphere.models.ProvisioningState; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import com.azure.resourcemanager.sphere.models.UpdatePolicy; +import com.azure.resourcemanager.sphere.models.DeviceGroupUpdateProperties; public final class DeviceGroupImpl implements DeviceGroup, DeviceGroup.Definition, DeviceGroup.Update { private DeviceGroupInner innerObject; @@ -34,32 +32,12 @@ public String type() { return this.innerModel().type(); } - public String description() { - return this.innerModel().description(); + public DeviceGroupProperties properties() { + return this.innerModel().properties(); } - public OSFeedType osFeedType() { - return this.innerModel().osFeedType(); - } - - public UpdatePolicy updatePolicy() { - return this.innerModel().updatePolicy(); - } - - public AllowCrashDumpCollection allowCrashDumpsCollection() { - return this.innerModel().allowCrashDumpsCollection(); - } - - public RegionalDataBoundary regionalDataBoundary() { - return this.innerModel().regionalDataBoundary(); - } - - public Boolean hasDeployment() { - return this.innerModel().hasDeployment(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -92,22 +70,14 @@ public DeviceGroupImpl withExistingProduct(String resourceGroupName, String cata } public DeviceGroup create() { - this.innerObject = - serviceManager - .serviceClient() - .getDeviceGroups() - .createOrUpdate( - resourceGroupName, catalogName, productName, deviceGroupName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient().getDeviceGroups().createOrUpdate(resourceGroupName, + catalogName, productName, deviceGroupName, this.innerModel(), Context.NONE); return this; } public DeviceGroup create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDeviceGroups() - .createOrUpdate( - resourceGroupName, catalogName, productName, deviceGroupName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient().getDeviceGroups().createOrUpdate(resourceGroupName, + catalogName, productName, deviceGroupName, this.innerModel(), context); return this; } @@ -123,125 +93,64 @@ public DeviceGroupImpl update() { } public DeviceGroup apply() { - this.innerObject = - serviceManager - .serviceClient() - .getDeviceGroups() - .update(resourceGroupName, catalogName, productName, deviceGroupName, updateProperties, Context.NONE); + this.innerObject = serviceManager.serviceClient().getDeviceGroups().update(resourceGroupName, catalogName, + productName, deviceGroupName, updateProperties, Context.NONE); return this; } public DeviceGroup apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDeviceGroups() - .update(resourceGroupName, catalogName, productName, deviceGroupName, updateProperties, context); + this.innerObject = serviceManager.serviceClient().getDeviceGroups().update(resourceGroupName, catalogName, + productName, deviceGroupName, updateProperties, context); return this; } DeviceGroupImpl(DeviceGroupInner innerObject, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.catalogName = Utils.getValueFromIdByName(innerObject.id(), "catalogs"); - this.productName = Utils.getValueFromIdByName(innerObject.id(), "products"); - this.deviceGroupName = Utils.getValueFromIdByName(innerObject.id(), "deviceGroups"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.catalogName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "catalogs"); + this.productName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "products"); + this.deviceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "deviceGroups"); } public DeviceGroup refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getDeviceGroups() - .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getDeviceGroups() + .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, Context.NONE).getValue(); return this; } public DeviceGroup refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDeviceGroups() - .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getDeviceGroups() + .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, context).getValue(); return this; } public void claimDevices(ClaimDevicesRequest claimDevicesRequest) { - serviceManager - .deviceGroups() - .claimDevices(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest); + serviceManager.deviceGroups().claimDevices(resourceGroupName, catalogName, productName, deviceGroupName, + claimDevicesRequest); } public void claimDevices(ClaimDevicesRequest claimDevicesRequest, Context context) { - serviceManager - .deviceGroups() - .claimDevices(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest, context); + serviceManager.deviceGroups().claimDevices(resourceGroupName, catalogName, productName, deviceGroupName, + claimDevicesRequest, context); } - public Response countDevicesWithResponse(Context context) { - return serviceManager - .deviceGroups() - .countDevicesWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, context); + public Response countDevicesWithResponse(Context context) { + return serviceManager.deviceGroups().countDevicesWithResponse(resourceGroupName, catalogName, productName, + deviceGroupName, context); } - public CountDeviceResponse countDevices() { + public CountDevicesResponse countDevices() { return serviceManager.deviceGroups().countDevices(resourceGroupName, catalogName, productName, deviceGroupName); } - public DeviceGroupImpl withDescription(String description) { - if (isInCreateMode()) { - this.innerModel().withDescription(description); - return this; - } else { - this.updateProperties.withDescription(description); - return this; - } - } - - public DeviceGroupImpl withOsFeedType(OSFeedType osFeedType) { - if (isInCreateMode()) { - this.innerModel().withOsFeedType(osFeedType); - return this; - } else { - this.updateProperties.withOsFeedType(osFeedType); - return this; - } - } - - public DeviceGroupImpl withUpdatePolicy(UpdatePolicy updatePolicy) { - if (isInCreateMode()) { - this.innerModel().withUpdatePolicy(updatePolicy); - return this; - } else { - this.updateProperties.withUpdatePolicy(updatePolicy); - return this; - } - } - - public DeviceGroupImpl withAllowCrashDumpsCollection(AllowCrashDumpCollection allowCrashDumpsCollection) { - if (isInCreateMode()) { - this.innerModel().withAllowCrashDumpsCollection(allowCrashDumpsCollection); - return this; - } else { - this.updateProperties.withAllowCrashDumpsCollection(allowCrashDumpsCollection); - return this; - } - } - - public DeviceGroupImpl withRegionalDataBoundary(RegionalDataBoundary regionalDataBoundary) { - if (isInCreateMode()) { - this.innerModel().withRegionalDataBoundary(regionalDataBoundary); - return this; - } else { - this.updateProperties.withRegionalDataBoundary(regionalDataBoundary); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; + public DeviceGroupImpl withProperties(DeviceGroupProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public DeviceGroupImpl withProperties(DeviceGroupUpdateProperties properties) { + this.updateProperties.withProperties(properties); + return this; } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupsClientImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupsClientImpl.java index 2e01c5ca4e09a..19c91bdbaf5fe 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupsClientImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupsClientImpl.java @@ -34,7 +34,7 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.sphere.fluent.DeviceGroupsClient; -import com.azure.resourcemanager.sphere.fluent.models.CountDeviceResponseInner; +import com.azure.resourcemanager.sphere.fluent.models.CountDevicesResponseInner; import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner; import com.azure.resourcemanager.sphere.models.ClaimDevicesRequest; import com.azure.resourcemanager.sphere.models.DeviceGroupListResult; @@ -43,165 +43,125 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in DeviceGroupsClient. */ +/** + * An instance of this class provides access to all the operations defined in DeviceGroupsClient. + */ public final class DeviceGroupsClientImpl implements DeviceGroupsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final DeviceGroupsService service; - /** The service client containing this operation class. */ - private final AzureSphereManagementClientImpl client; + /** + * The service client containing this operation class. + */ + private final AzureSphereMgmtClientImpl client; /** * Initializes an instance of DeviceGroupsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - DeviceGroupsClientImpl(AzureSphereManagementClientImpl client) { - this.service = - RestProxy.create(DeviceGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + DeviceGroupsClientImpl(AzureSphereMgmtClientImpl client) { + this.service + = RestProxy.create(DeviceGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureSphereManagementClientDeviceGroups to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for AzureSphereMgmtClientDeviceGroups to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "AzureSphereManagemen") + @ServiceInterface(name = "AzureSphereMgmtClien") public interface DeviceGroupsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByProduct( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @QueryParam("$skip") Integer skip, - @QueryParam("$maxpagesize") Integer maxpagesize, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @PathParam("productName") String productName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}") - @ExpectedResponses({200}) + Mono> listByProduct(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}") + @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("catalogName") String catalogName, - @PathParam("productName") String productName, - @PathParam("deviceGroupName") String deviceGroupName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}") - @ExpectedResponses({200, 201}) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}") + @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("catalogName") String catalogName, - @PathParam("productName") String productName, - @PathParam("deviceGroupName") String deviceGroupName, - @BodyParam("application/json") DeviceGroupInner resource, - @HeaderParam("Accept") String accept, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @BodyParam("application/json") DeviceGroupInner resource, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}") - @ExpectedResponses({200, 202}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @PathParam("productName") String productName, - @PathParam("deviceGroupName") String deviceGroupName, - @BodyParam("application/json") DeviceGroupUpdate properties, - @HeaderParam("Accept") String accept, + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @BodyParam("application/json") DeviceGroupUpdate properties, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}") - @ExpectedResponses({200, 202, 204}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}") + @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("catalogName") String catalogName, - @PathParam("productName") String productName, - @PathParam("deviceGroupName") String deviceGroupName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/claimDevices") - @ExpectedResponses({202}) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/claimDevices") + @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> claimDevices( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @PathParam("productName") String productName, - @PathParam("deviceGroupName") String deviceGroupName, + Mono>> claimDevices(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, @BodyParam("application/json") ClaimDevicesRequest claimDevicesRequest, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/countDevices") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/countDevices") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> countDevices( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @PathParam("productName") String productName, - @PathParam("deviceGroupName") String deviceGroupName, - @HeaderParam("Accept") String accept, - Context context); + Mono> countDevices(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByProductNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used * for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -213,28 +173,18 @@ Mono> listByProductNext( * @throws ManagementException thrown 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 a DeviceGroup list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByProductSinglePageAsync( - String resourceGroupName, - String catalogName, - String productName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize) { + private Mono> listByProductSinglePageAsync(String resourceGroupName, + String catalogName, String productName, String filter, Integer top, Integer skip, Integer maxpagesize) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -248,38 +198,18 @@ private Mono> listByProductSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByProduct( - this.client.getEndpoint(), - filter, - top, - skip, - maxpagesize, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByProduct(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, + productName, accept, context)) + .>map(res -> new 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 DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used * for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -292,29 +222,19 @@ private Mono> listByProductSinglePageAsync( * @throws ManagementException thrown 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 a DeviceGroup list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByProductSinglePageAsync( - String resourceGroupName, - String catalogName, - String productName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, + private Mono> listByProductSinglePageAsync(String resourceGroupName, + String catalogName, String productName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -329,34 +249,16 @@ private Mono> listByProductSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByProduct( - this.client.getEndpoint(), - filter, - top, - skip, - maxpagesize, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByProduct(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, filter, top, skip, maxpagesize, catalogName, productName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used * for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -370,25 +272,16 @@ private Mono> listByProductSinglePageAsync( * @return the response of a DeviceGroup list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByProductAsync( - String resourceGroupName, - String catalogName, - String productName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize) { - return new PagedFlux<>( - () -> - listByProductSinglePageAsync( - resourceGroupName, catalogName, productName, filter, top, skip, maxpagesize), - nextLink -> listByProductNextSinglePageAsync(nextLink)); + private PagedFlux listByProductAsync(String resourceGroupName, String catalogName, + String productName, String filter, Integer top, Integer skip, Integer maxpagesize) { + return new PagedFlux<>(() -> listByProductSinglePageAsync(resourceGroupName, catalogName, productName, filter, + top, skip, maxpagesize), nextLink -> listByProductNextSinglePageAsync(nextLink)); } /** * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used * for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -398,23 +291,20 @@ private PagedFlux listByProductAsync( * @return the response of a DeviceGroup list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByProductAsync( - String resourceGroupName, String catalogName, String productName) { + private PagedFlux listByProductAsync(String resourceGroupName, String catalogName, + String productName) { final String filter = null; final Integer top = null; final Integer skip = null; final Integer maxpagesize = null; - return new PagedFlux<>( - () -> - listByProductSinglePageAsync( - resourceGroupName, catalogName, productName, filter, top, skip, maxpagesize), - nextLink -> listByProductNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listByProductSinglePageAsync(resourceGroupName, catalogName, productName, filter, + top, skip, maxpagesize), nextLink -> listByProductNextSinglePageAsync(nextLink)); } /** * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used * for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -429,26 +319,16 @@ private PagedFlux listByProductAsync( * @return the response of a DeviceGroup list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByProductAsync( - String resourceGroupName, - String catalogName, - String productName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { - return new PagedFlux<>( - () -> - listByProductSinglePageAsync( - resourceGroupName, catalogName, productName, filter, top, skip, maxpagesize, context), - nextLink -> listByProductNextSinglePageAsync(nextLink, context)); + private PagedFlux listByProductAsync(String resourceGroupName, String catalogName, + String productName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { + return new PagedFlux<>(() -> listByProductSinglePageAsync(resourceGroupName, catalogName, productName, filter, + top, skip, maxpagesize, context), nextLink -> listByProductNextSinglePageAsync(nextLink, context)); } /** * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used * for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -458,8 +338,8 @@ private PagedFlux listByProductAsync( * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByProduct( - String resourceGroupName, String catalogName, String productName) { + public PagedIterable listByProduct(String resourceGroupName, String catalogName, + String productName) { final String filter = null; final Integer top = null; final Integer skip = null; @@ -471,7 +351,7 @@ public PagedIterable listByProduct( /** * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used * for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -486,15 +366,8 @@ public PagedIterable listByProduct( * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByProduct( - String resourceGroupName, - String catalogName, - String productName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { + public PagedIterable listByProduct(String resourceGroupName, String catalogName, + String productName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { return new PagedIterable<>( listByProductAsync(resourceGroupName, catalogName, productName, filter, top, skip, maxpagesize, context)); } @@ -502,7 +375,7 @@ public PagedIterable listByProduct( /** * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -513,19 +386,15 @@ public PagedIterable listByProduct( * @return a DeviceGroup along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { + private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -543,26 +412,16 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -574,19 +433,15 @@ private Mono> getWithResponseAsync( * @return a DeviceGroup along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -604,23 +459,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, productName, deviceGroupName, accept, context); } /** * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -631,8 +477,8 @@ private Mono> getWithResponseAsync( * @return a DeviceGroup on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { + private Mono getAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName) { return getWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -640,7 +486,7 @@ private Mono getAsync( /** * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -652,15 +498,15 @@ private Mono getAsync( * @return a DeviceGroup along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context) { + public Response getWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, Context context) { return getWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, context).block(); } /** * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -671,15 +517,15 @@ public Response getWithResponse( * @return a DeviceGroup. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceGroupInner get( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { + public DeviceGroupInner get(String resourceGroupName, String catalogName, String productName, + String deviceGroupName) { return getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, Context.NONE).getValue(); } /** * Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -689,26 +535,18 @@ public DeviceGroupInner get( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an device group resource belonging to a product resource along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupInner resource) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, DeviceGroupInner resource) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -731,27 +569,16 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - resource, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, resource, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -762,27 +589,18 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an device group resource belonging to a product resource along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupInner resource, - Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, DeviceGroupInner resource, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -805,24 +623,15 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - resource, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, resource, + accept, context); } /** * Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -835,27 +644,18 @@ private Mono>> createOrUpdateWithResponseAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DeviceGroupInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, + String resourceGroupName, String catalogName, String productName, String deviceGroupName, DeviceGroupInner resource) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, resource); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeviceGroupInner.class, - DeviceGroupInner.class, - this.client.getContext()); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DeviceGroupInner.class, DeviceGroupInner.class, this.client.getContext()); } /** * Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -869,26 +669,19 @@ private PollerFlux, DeviceGroupInner> beginCreateOr */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, DeviceGroupInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupInner resource, - Context context) { + String resourceGroupName, String catalogName, String productName, String deviceGroupName, + DeviceGroupInner resource, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, catalogName, productName, deviceGroupName, resource, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DeviceGroupInner.class, DeviceGroupInner.class, context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, + productName, deviceGroupName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DeviceGroupInner.class, DeviceGroupInner.class, context); } /** * Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -900,21 +693,16 @@ private PollerFlux, DeviceGroupInner> beginCreateOr * @return the {@link SyncPoller} for polling of an device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeviceGroupInner> beginCreateOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupInner resource) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, resource) + public SyncPoller, DeviceGroupInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, DeviceGroupInner resource) { + return this.beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, resource) .getSyncPoller(); } /** * Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -927,13 +715,8 @@ public SyncPoller, DeviceGroupInner> beginCreateOrU * @return the {@link SyncPoller} for polling of an device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeviceGroupInner> beginCreateOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupInner resource, - Context context) { + public SyncPoller, DeviceGroupInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, DeviceGroupInner resource, Context context) { return this .beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, resource, context) .getSyncPoller(); @@ -942,7 +725,7 @@ public SyncPoller, DeviceGroupInner> beginCreateOrU /** * Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -954,21 +737,16 @@ public SyncPoller, DeviceGroupInner> beginCreateOrU * @return an device group resource belonging to a product resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupInner resource) { - return beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, resource) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, DeviceGroupInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, resource).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -981,22 +759,16 @@ private Mono createOrUpdateAsync( * @return an device group resource belonging to a product resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupInner resource, - Context context) { + private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, DeviceGroupInner resource, Context context) { return beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, resource, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + .last().flatMap(this.client::getLroFinalResultOrError); } /** * Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1008,19 +780,15 @@ private Mono createOrUpdateAsync( * @return an device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceGroupInner createOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupInner resource) { + public DeviceGroupInner createOrUpdate(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, DeviceGroupInner resource) { return createOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, resource).block(); } /** * Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1033,13 +801,8 @@ public DeviceGroupInner createOrUpdate( * @return an device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceGroupInner createOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupInner resource, - Context context) { + public DeviceGroupInner createOrUpdate(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, DeviceGroupInner resource, Context context) { return createOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, resource, context) .block(); } @@ -1047,7 +810,7 @@ public DeviceGroupInner createOrUpdate( /** * Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1057,26 +820,18 @@ public DeviceGroupInner createOrUpdate( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an device group resource belonging to a product resource along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupUpdate properties) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, DeviceGroupUpdate properties) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1099,27 +854,16 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - properties, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + properties, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1130,27 +874,18 @@ private Mono>> updateWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an device group resource belonging to a product resource along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupUpdate properties, - Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, DeviceGroupUpdate properties, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1173,24 +908,14 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - properties, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, productName, deviceGroupName, properties, accept, context); } /** * Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1202,28 +927,18 @@ private Mono>> updateWithResponseAsync( * @return the {@link PollerFlux} for polling of an device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeviceGroupInner> beginUpdateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupUpdate properties) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, properties); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - DeviceGroupInner.class, - DeviceGroupInner.class, - this.client.getContext()); + private PollerFlux, DeviceGroupInner> beginUpdateAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, DeviceGroupUpdate properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DeviceGroupInner.class, DeviceGroupInner.class, this.client.getContext()); } /** * Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1236,26 +951,19 @@ private PollerFlux, DeviceGroupInner> beginUpdateAs * @return the {@link PollerFlux} for polling of an device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeviceGroupInner> beginUpdateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupUpdate properties, - Context context) { + private PollerFlux, DeviceGroupInner> beginUpdateAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, DeviceGroupUpdate properties, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, properties, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DeviceGroupInner.class, DeviceGroupInner.class, context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, catalogName, productName, + deviceGroupName, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DeviceGroupInner.class, DeviceGroupInner.class, context); } /** * Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1267,21 +975,16 @@ private PollerFlux, DeviceGroupInner> beginUpdateAs * @return the {@link SyncPoller} for polling of an device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeviceGroupInner> beginUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupUpdate properties) { - return this - .beginUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, properties) + public SyncPoller, DeviceGroupInner> beginUpdate(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, DeviceGroupUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, properties) .getSyncPoller(); } /** * Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1294,22 +997,16 @@ public SyncPoller, DeviceGroupInner> beginUpdate( * @return the {@link SyncPoller} for polling of an device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeviceGroupInner> beginUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupUpdate properties, - Context context) { - return this - .beginUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, properties, context) + public SyncPoller, DeviceGroupInner> beginUpdate(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, DeviceGroupUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, properties, context) .getSyncPoller(); } /** * Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1321,21 +1018,16 @@ public SyncPoller, DeviceGroupInner> beginUpdate( * @return an device group resource belonging to a product resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupUpdate properties) { - return beginUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, properties) - .last() + private Mono updateAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, DeviceGroupUpdate properties) { + return beginUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, properties).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1348,22 +1040,16 @@ private Mono updateAsync( * @return an device group resource belonging to a product resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupUpdate properties, - Context context) { + private Mono updateAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, DeviceGroupUpdate properties, Context context) { return beginUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, properties, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + .last().flatMap(this.client::getLroFinalResultOrError); } /** * Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1375,19 +1061,15 @@ private Mono updateAsync( * @return an device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceGroupInner update( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupUpdate properties) { + public DeviceGroupInner update(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, DeviceGroupUpdate properties) { return updateAsync(resourceGroupName, catalogName, productName, deviceGroupName, properties).block(); } /** * Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1400,20 +1082,15 @@ public DeviceGroupInner update( * @return an device group resource belonging to a product resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceGroupInner update( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - DeviceGroupUpdate properties, - Context context) { + public DeviceGroupInner update(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, DeviceGroupUpdate properties, Context context) { return updateAsync(resourceGroupName, catalogName, productName, deviceGroupName, properties, context).block(); } /** * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1424,19 +1101,15 @@ public DeviceGroupInner update( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1454,26 +1127,16 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1485,19 +1148,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1515,23 +1174,14 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, productName, deviceGroupName, accept, context); } /** * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1542,20 +1192,18 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1567,20 +1215,19 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1591,15 +1238,15 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + String productName, String deviceGroupName) { return this.beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName).getSyncPoller(); } /** * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1611,17 +1258,16 @@ public SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context) { - return this - .beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, context) + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, Context context) { + return this.beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, context) .getSyncPoller(); } /** * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1632,17 +1278,16 @@ public SyncPoller, Void> beginDelete( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { - return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName) - .last() + private Mono deleteAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName) { + return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1654,17 +1299,16 @@ private Mono deleteAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context) { - return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, context) - .last() + private Mono deleteAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, Context context) { + return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1681,7 +1325,7 @@ public void delete(String resourceGroupName, String catalogName, String productN /** * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1692,15 +1336,15 @@ public void delete(String resourceGroupName, String catalogName, String productN * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context) { + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + Context context) { deleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, context).block(); } /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk * claiming devices to a catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1712,23 +1356,15 @@ public void delete( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> claimDevicesWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - ClaimDevicesRequest claimDevicesRequest) { + private Mono>> claimDevicesWithResponseAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1752,27 +1388,16 @@ private Mono>> claimDevicesWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .claimDevices( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - claimDevicesRequest, - accept, - context)) + .withContext(context -> service.claimDevices(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + claimDevicesRequest, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk * claiming devices to a catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1785,24 +1410,15 @@ private Mono>> claimDevicesWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> claimDevicesWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - ClaimDevicesRequest claimDevicesRequest, - Context context) { + private Mono>> claimDevicesWithResponseAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1826,24 +1442,15 @@ private Mono>> claimDevicesWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .claimDevices( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - claimDevicesRequest, - accept, - context); + return service.claimDevices(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + claimDevicesRequest, accept, context); } /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk * claiming devices to a catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1855,25 +1462,18 @@ private Mono>> claimDevicesWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginClaimDevicesAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - ClaimDevicesRequest claimDevicesRequest) { - Mono>> mono = - claimDevicesWithResponseAsync( - resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + private PollerFlux, Void> beginClaimDevicesAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest) { + Mono>> mono = claimDevicesWithResponseAsync(resourceGroupName, catalogName, + productName, deviceGroupName, claimDevicesRequest); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk * claiming devices to a catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1886,26 +1486,19 @@ private PollerFlux, Void> beginClaimDevicesAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginClaimDevicesAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - ClaimDevicesRequest claimDevicesRequest, - Context context) { + private PollerFlux, Void> beginClaimDevicesAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - claimDevicesWithResponseAsync( - resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono = claimDevicesWithResponseAsync(resourceGroupName, catalogName, + productName, deviceGroupName, claimDevicesRequest, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk * claiming devices to a catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1917,12 +1510,8 @@ private PollerFlux, Void> beginClaimDevicesAsync( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginClaimDevices( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - ClaimDevicesRequest claimDevicesRequest) { + public SyncPoller, Void> beginClaimDevices(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest) { return this .beginClaimDevicesAsync(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest) .getSyncPoller(); @@ -1931,7 +1520,7 @@ public SyncPoller, Void> beginClaimDevices( /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk * claiming devices to a catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1944,23 +1533,16 @@ public SyncPoller, Void> beginClaimDevices( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginClaimDevices( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - ClaimDevicesRequest claimDevicesRequest, - Context context) { - return this - .beginClaimDevicesAsync( - resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest, context) - .getSyncPoller(); + public SyncPoller, Void> beginClaimDevices(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest, Context context) { + return this.beginClaimDevicesAsync(resourceGroupName, catalogName, productName, deviceGroupName, + claimDevicesRequest, context).getSyncPoller(); } /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk * claiming devices to a catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1972,21 +1554,16 @@ public SyncPoller, Void> beginClaimDevices( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono claimDevicesAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - ClaimDevicesRequest claimDevicesRequest) { + private Mono claimDevicesAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, ClaimDevicesRequest claimDevicesRequest) { return beginClaimDevicesAsync(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest) - .last() - .flatMap(this.client::getLroFinalResultOrError); + .last().flatMap(this.client::getLroFinalResultOrError); } /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk * claiming devices to a catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1999,23 +1576,16 @@ private Mono claimDevicesAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono claimDevicesAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - ClaimDevicesRequest claimDevicesRequest, - Context context) { - return beginClaimDevicesAsync( - resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono claimDevicesAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, ClaimDevicesRequest claimDevicesRequest, Context context) { + return beginClaimDevicesAsync(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest, + context).last().flatMap(this.client::getLroFinalResultOrError); } /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk * claiming devices to a catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -2026,11 +1596,7 @@ private Mono claimDevicesAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void claimDevices( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, + public void claimDevices(String resourceGroupName, String catalogName, String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest) { claimDevicesAsync(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest).block(); } @@ -2038,7 +1604,7 @@ public void claimDevices( /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk * claiming devices to a catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -2050,13 +1616,8 @@ public void claimDevices( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void claimDevices( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - ClaimDevicesRequest claimDevicesRequest, - Context context) { + public void claimDevices(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + ClaimDevicesRequest claimDevicesRequest, Context context) { claimDevicesAsync(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest, context) .block(); } @@ -2064,7 +1625,7 @@ public void claimDevices( /** * Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for * product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -2073,22 +1634,18 @@ public void claimDevices( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response to the action call for count devices in a catalog along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> countDevicesWithResponseAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { + private Mono> countDevicesWithResponseAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2106,26 +1663,16 @@ private Mono> countDevicesWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .countDevices( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - accept, - context)) + .withContext(context -> service.countDevices(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for * product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -2135,22 +1682,18 @@ private Mono> countDevicesWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response to the action call for count devices in a catalog along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> countDevicesWithResponseAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context) { + private Mono> countDevicesWithResponseAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -2168,23 +1711,15 @@ private Mono> countDevicesWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .countDevices( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - accept, - context); + return service.countDevices(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, accept, + context); } /** * Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for * product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -2195,8 +1730,8 @@ private Mono> countDevicesWithResponseAsync( * @return response to the action call for count devices in a catalog on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono countDevicesAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { + private Mono countDevicesAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName) { return countDevicesWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -2204,7 +1739,7 @@ private Mono countDevicesAsync( /** * Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for * product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -2216,8 +1751,8 @@ private Mono countDevicesAsync( * @return response to the action call for count devices in a catalog along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response countDevicesWithResponse( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context) { + public Response countDevicesWithResponse(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, Context context) { return countDevicesWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, context) .block(); } @@ -2225,7 +1760,7 @@ public Response countDevicesWithResponse( /** * Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for * product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -2236,22 +1771,23 @@ public Response countDevicesWithResponse( * @return response to the action call for count devices in a catalog. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CountDeviceResponseInner countDevices( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { + public CountDevicesResponseInner countDevices(String resourceGroupName, String catalogName, String productName, + String deviceGroupName) { return countDevicesWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, Context.NONE) .getValue(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 a DeviceGroup list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByProductNextSinglePageAsync(String nextLink) { @@ -2259,37 +1795,29 @@ private Mono> listByProductNextSinglePageAsync(S return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByProductNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 a DeviceGroup list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByProductNextSinglePageAsync(String nextLink, Context context) { @@ -2297,23 +1825,13 @@ private Mono> listByProductNextSinglePageAsync(S return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByProductNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByProductNext(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/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupsImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupsImpl.java index 3e768fc39155e..cc065b225694c 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupsImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceGroupsImpl.java @@ -10,10 +10,10 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.sphere.fluent.DeviceGroupsClient; -import com.azure.resourcemanager.sphere.fluent.models.CountDeviceResponseInner; +import com.azure.resourcemanager.sphere.fluent.models.CountDevicesResponseInner; import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner; import com.azure.resourcemanager.sphere.models.ClaimDevicesRequest; -import com.azure.resourcemanager.sphere.models.CountDeviceResponse; +import com.azure.resourcemanager.sphere.models.CountDevicesResponse; import com.azure.resourcemanager.sphere.models.DeviceGroup; import com.azure.resourcemanager.sphere.models.DeviceGroups; @@ -24,43 +24,31 @@ public final class DeviceGroupsImpl implements DeviceGroups { private final com.azure.resourcemanager.sphere.AzureSphereManager serviceManager; - public DeviceGroupsImpl( - DeviceGroupsClient innerClient, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { + public DeviceGroupsImpl(DeviceGroupsClient innerClient, + com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable listByProduct(String resourceGroupName, String catalogName, String productName) { - PagedIterable inner = - this.serviceClient().listByProduct(resourceGroupName, catalogName, productName); - return Utils.mapPage(inner, inner1 -> new DeviceGroupImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByProduct(resourceGroupName, catalogName, productName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceGroupImpl(inner1, this.manager())); } - public PagedIterable listByProduct( - String resourceGroupName, - String catalogName, - String productName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { - PagedIterable inner = - this - .serviceClient() - .listByProduct(resourceGroupName, catalogName, productName, filter, top, skip, maxpagesize, context); - return Utils.mapPage(inner, inner1 -> new DeviceGroupImpl(inner1, this.manager())); + public PagedIterable listByProduct(String resourceGroupName, String catalogName, String productName, + String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { + PagedIterable inner = this.serviceClient().listByProduct(resourceGroupName, catalogName, + productName, filter, top, skip, maxpagesize, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceGroupImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, context); + public Response getWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, catalogName, + productName, deviceGroupName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new DeviceGroupImpl(inner.getValue(), this.manager())); } else { return null; @@ -80,192 +68,139 @@ public void delete(String resourceGroupName, String catalogName, String productN this.serviceClient().delete(resourceGroupName, catalogName, productName, deviceGroupName); } - public void delete( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context) { + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + Context context) { this.serviceClient().delete(resourceGroupName, catalogName, productName, deviceGroupName, context); } - public void claimDevices( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, + public void claimDevices(String resourceGroupName, String catalogName, String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest) { - this - .serviceClient() - .claimDevices(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest); + this.serviceClient().claimDevices(resourceGroupName, catalogName, productName, deviceGroupName, + claimDevicesRequest); } - public void claimDevices( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - ClaimDevicesRequest claimDevicesRequest, - Context context) { - this - .serviceClient() - .claimDevices(resourceGroupName, catalogName, productName, deviceGroupName, claimDevicesRequest, context); + public void claimDevices(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + ClaimDevicesRequest claimDevicesRequest, Context context) { + this.serviceClient().claimDevices(resourceGroupName, catalogName, productName, deviceGroupName, + claimDevicesRequest, context); } - public Response countDevicesWithResponse( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context) { - Response inner = - this - .serviceClient() - .countDevicesWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, context); + public Response countDevicesWithResponse(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, Context context) { + Response inner = this.serviceClient().countDevicesWithResponse(resourceGroupName, + catalogName, productName, deviceGroupName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new CountDeviceResponseImpl(inner.getValue(), this.manager())); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CountDevicesResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public CountDeviceResponse countDevices( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { - CountDeviceResponseInner inner = - this.serviceClient().countDevices(resourceGroupName, catalogName, productName, deviceGroupName); + public CountDevicesResponse countDevices(String resourceGroupName, String catalogName, String productName, + String deviceGroupName) { + CountDevicesResponseInner inner + = this.serviceClient().countDevices(resourceGroupName, catalogName, productName, deviceGroupName); if (inner != null) { - return new CountDeviceResponseImpl(inner, this.manager()); + return new CountDevicesResponseImpl(inner, this.manager()); } else { return null; } } public DeviceGroup getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String productName = Utils.getValueFromIdByName(id, "products"); + String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); if (productName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); } - String deviceGroupName = Utils.getValueFromIdByName(id, "deviceGroups"); + String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); if (deviceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); } - return this - .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, Context.NONE) + return this.getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, Context.NONE) .getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String productName = Utils.getValueFromIdByName(id, "products"); + String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); if (productName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); } - String deviceGroupName = Utils.getValueFromIdByName(id, "deviceGroups"); + String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); if (deviceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); } return this.getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String productName = Utils.getValueFromIdByName(id, "products"); + String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); if (productName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); } - String deviceGroupName = Utils.getValueFromIdByName(id, "deviceGroups"); + String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); if (deviceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); } this.delete(resourceGroupName, catalogName, productName, deviceGroupName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String productName = Utils.getValueFromIdByName(id, "products"); + String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); if (productName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); } - String deviceGroupName = Utils.getValueFromIdByName(id, "deviceGroups"); + String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); if (deviceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); } this.delete(resourceGroupName, catalogName, productName, deviceGroupName, context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceImpl.java index a7b8dd47135f1..76751b21d613f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceImpl.java @@ -4,14 +4,15 @@ package com.azure.resourcemanager.sphere.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.sphere.fluent.models.DeviceInner; import com.azure.resourcemanager.sphere.models.Device; +import com.azure.resourcemanager.sphere.models.DeviceProperties; import com.azure.resourcemanager.sphere.models.DeviceUpdate; +import com.azure.resourcemanager.sphere.models.DeviceUpdateProperties; import com.azure.resourcemanager.sphere.models.GenerateCapabilityImageRequest; -import com.azure.resourcemanager.sphere.models.ProvisioningState; import com.azure.resourcemanager.sphere.models.SignedCapabilityImageResponse; -import java.time.OffsetDateTime; public final class DeviceImpl implements Device, Device.Definition, Device.Update { private DeviceInner innerObject; @@ -30,32 +31,12 @@ public String type() { return this.innerModel().type(); } - public String deviceId() { - return this.innerModel().deviceId(); + public DeviceProperties properties() { + return this.innerModel().properties(); } - public String chipSku() { - return this.innerModel().chipSku(); - } - - public String lastAvailableOsVersion() { - return this.innerModel().lastAvailableOsVersion(); - } - - public String lastInstalledOsVersion() { - return this.innerModel().lastInstalledOsVersion(); - } - - public OffsetDateTime lastOsUpdateUtc() { - return this.innerModel().lastOsUpdateUtc(); - } - - public OffsetDateTime lastUpdateRequestUtc() { - return this.innerModel().lastUpdateRequestUtc(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -82,8 +63,8 @@ private com.azure.resourcemanager.sphere.AzureSphereManager manager() { private DeviceUpdate updateProperties; - public DeviceImpl withExistingDeviceGroup( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { + public DeviceImpl withExistingDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName) { this.resourceGroupName = resourceGroupName; this.catalogName = catalogName; this.productName = productName; @@ -92,34 +73,14 @@ public DeviceImpl withExistingDeviceGroup( } public Device create() { - this.innerObject = - serviceManager - .serviceClient() - .getDevices() - .createOrUpdate( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - this.innerModel(), - Context.NONE); + this.innerObject = serviceManager.serviceClient().getDevices().createOrUpdate(resourceGroupName, catalogName, + productName, deviceGroupName, deviceName, this.innerModel(), Context.NONE); return this; } public Device create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDevices() - .createOrUpdate( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - this.innerModel(), - context); + this.innerObject = serviceManager.serviceClient().getDevices().createOrUpdate(resourceGroupName, catalogName, + productName, deviceGroupName, deviceName, this.innerModel(), context); return this; } @@ -135,101 +96,60 @@ public DeviceImpl update() { } public Device apply() { - this.innerObject = - serviceManager - .serviceClient() - .getDevices() - .update( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - updateProperties, - Context.NONE); + this.innerObject = serviceManager.serviceClient().getDevices().update(resourceGroupName, catalogName, + productName, deviceGroupName, deviceName, updateProperties, Context.NONE); return this; } public Device apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDevices() - .update( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - updateProperties, - context); + this.innerObject = serviceManager.serviceClient().getDevices().update(resourceGroupName, catalogName, + productName, deviceGroupName, deviceName, updateProperties, context); return this; } DeviceImpl(DeviceInner innerObject, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.catalogName = Utils.getValueFromIdByName(innerObject.id(), "catalogs"); - this.productName = Utils.getValueFromIdByName(innerObject.id(), "products"); - this.deviceGroupName = Utils.getValueFromIdByName(innerObject.id(), "deviceGroups"); - this.deviceName = Utils.getValueFromIdByName(innerObject.id(), "devices"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.catalogName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "catalogs"); + this.productName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "products"); + this.deviceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "deviceGroups"); + this.deviceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "devices"); } public Device refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getDevices() - .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getDevices() + .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, Context.NONE) + .getValue(); return this; } public Device refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDevices() - .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getDevices() + .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context) + .getValue(); return this; } - public SignedCapabilityImageResponse generateCapabilityImage( - GenerateCapabilityImageRequest generateDeviceCapabilityRequest) { - return serviceManager - .devices() - .generateCapabilityImage( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - generateDeviceCapabilityRequest); - } - - public SignedCapabilityImageResponse generateCapabilityImage( - GenerateCapabilityImageRequest generateDeviceCapabilityRequest, Context context) { - return serviceManager - .devices() - .generateCapabilityImage( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - generateDeviceCapabilityRequest, - context); - } - - public DeviceImpl withDeviceId(String deviceId) { - this.innerModel().withDeviceId(deviceId); + public SignedCapabilityImageResponse + generateCapabilityImage(GenerateCapabilityImageRequest generateDeviceCapabilityRequest) { + return serviceManager.devices().generateCapabilityImage(resourceGroupName, catalogName, productName, + deviceGroupName, deviceName, generateDeviceCapabilityRequest); + } + + public SignedCapabilityImageResponse + generateCapabilityImage(GenerateCapabilityImageRequest generateDeviceCapabilityRequest, Context context) { + return serviceManager.devices().generateCapabilityImage(resourceGroupName, catalogName, productName, + deviceGroupName, deviceName, generateDeviceCapabilityRequest, context); + } + + public DeviceImpl withProperties(DeviceProperties properties) { + this.innerModel().withProperties(properties); return this; } - public DeviceImpl withDeviceGroupId(String deviceGroupId) { - this.updateProperties.withDeviceGroupId(deviceGroupId); + public DeviceImpl withProperties(DeviceUpdateProperties properties) { + this.updateProperties.withProperties(properties); return this; } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceInsightImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceInsightImpl.java index 8ad28a3361318..1671950314c7f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceInsightImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DeviceInsightImpl.java @@ -13,8 +13,8 @@ public final class DeviceInsightImpl implements DeviceInsight { private final com.azure.resourcemanager.sphere.AzureSphereManager serviceManager; - DeviceInsightImpl( - DeviceInsightInner innerObject, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { + DeviceInsightImpl(DeviceInsightInner innerObject, + com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DevicesClientImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DevicesClientImpl.java index ab9b3fdad9735..96ee4df6e0624 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DevicesClientImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DevicesClientImpl.java @@ -43,150 +43,114 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in DevicesClient. */ +/** + * An instance of this class provides access to all the operations defined in DevicesClient. + */ public final class DevicesClientImpl implements DevicesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final DevicesService service; - /** The service client containing this operation class. */ - private final AzureSphereManagementClientImpl client; + /** + * The service client containing this operation class. + */ + private final AzureSphereMgmtClientImpl client; /** * Initializes an instance of DevicesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - DevicesClientImpl(AzureSphereManagementClientImpl client) { + DevicesClientImpl(AzureSphereMgmtClientImpl client) { this.service = RestProxy.create(DevicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureSphereManagementClientDevices to be used by the proxy service to + * The interface defining all the services for AzureSphereMgmtClientDevices to be used by the proxy service to * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "AzureSphereManagemen") + @ServiceInterface(name = "AzureSphereMgmtClien") public interface DevicesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDeviceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @PathParam("productName") String productName, - @PathParam("deviceGroupName") String deviceGroupName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}") - @ExpectedResponses({200}) + Mono> listByDeviceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}") + @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("catalogName") String catalogName, - @PathParam("productName") String productName, - @PathParam("deviceGroupName") String deviceGroupName, - @PathParam("deviceName") String deviceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}") - @ExpectedResponses({200, 201}) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @PathParam("deviceName") String deviceName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}") + @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("catalogName") String catalogName, - @PathParam("productName") String productName, - @PathParam("deviceGroupName") String deviceGroupName, - @PathParam("deviceName") String deviceName, - @BodyParam("application/json") DeviceInner resource, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}") - @ExpectedResponses({200, 202}) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @PathParam("deviceName") String deviceName, @BodyParam("application/json") DeviceInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @PathParam("productName") String productName, - @PathParam("deviceGroupName") String deviceGroupName, - @PathParam("deviceName") String deviceName, - @BodyParam("application/json") DeviceUpdate properties, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}") - @ExpectedResponses({200, 202, 204}) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @PathParam("deviceName") String deviceName, @BodyParam("application/json") DeviceUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}") + @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("catalogName") String catalogName, - @PathParam("productName") String productName, - @PathParam("deviceGroupName") String deviceGroupName, - @PathParam("deviceName") String deviceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}/generateCapabilityImage") - @ExpectedResponses({200, 202}) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, + @PathParam("deviceName") String deviceName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/devices/{deviceName}/generateCapabilityImage") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> generateCapabilityImage( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @PathParam("productName") String productName, - @PathParam("deviceGroupName") String deviceGroupName, + Mono>> generateCapabilityImage(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @PathParam("deviceGroupName") String deviceGroupName, @PathParam("deviceName") String deviceName, @BodyParam("application/json") GenerateCapabilityImageRequest generateDeviceCapabilityRequest, - @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByDeviceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used * for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -195,22 +159,18 @@ Mono> listByDeviceGroupNext( * @throws ManagementException thrown 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 a Device list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDeviceGroupSinglePageAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { + private Mono> listByDeviceGroupSinglePageAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -228,35 +188,18 @@ private Mono> listByDeviceGroupSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByDeviceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByDeviceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, accept, + context)) + .>map(res -> new 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 Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used * for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -266,22 +209,18 @@ private Mono> listByDeviceGroupSinglePageAsync( * @throws ManagementException thrown 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 a Device list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDeviceGroupSinglePageAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context) { + private Mono> listByDeviceGroupSinglePageAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -300,31 +239,16 @@ private Mono> listByDeviceGroupSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByDeviceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByDeviceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, productName, deviceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used * for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -335,8 +259,8 @@ private Mono> listByDeviceGroupSinglePageAsync( * @return the response of a Device list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDeviceGroupAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { + private PagedFlux listByDeviceGroupAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName) { return new PagedFlux<>( () -> listByDeviceGroupSinglePageAsync(resourceGroupName, catalogName, productName, deviceGroupName), nextLink -> listByDeviceGroupNextSinglePageAsync(nextLink)); @@ -345,7 +269,7 @@ private PagedFlux listByDeviceGroupAsync( /** * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used * for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -357,18 +281,16 @@ private PagedFlux listByDeviceGroupAsync( * @return the response of a Device list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDeviceGroupAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context) { - return new PagedFlux<>( - () -> - listByDeviceGroupSinglePageAsync(resourceGroupName, catalogName, productName, deviceGroupName, context), - nextLink -> listByDeviceGroupNextSinglePageAsync(nextLink, context)); + private PagedFlux listByDeviceGroupAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, Context context) { + return new PagedFlux<>(() -> listByDeviceGroupSinglePageAsync(resourceGroupName, catalogName, productName, + deviceGroupName, context), nextLink -> listByDeviceGroupNextSinglePageAsync(nextLink, context)); } /** * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used * for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -379,8 +301,8 @@ private PagedFlux listByDeviceGroupAsync( * @return the response of a Device list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDeviceGroup( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { + public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, + String productName, String deviceGroupName) { return new PagedIterable<>( listByDeviceGroupAsync(resourceGroupName, catalogName, productName, deviceGroupName)); } @@ -388,7 +310,7 @@ public PagedIterable listByDeviceGroup( /** * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used * for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -400,8 +322,8 @@ public PagedIterable listByDeviceGroup( * @return the response of a Device list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDeviceGroup( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context) { + public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, Context context) { return new PagedIterable<>( listByDeviceGroupAsync(resourceGroupName, catalogName, productName, deviceGroupName, context)); } @@ -409,7 +331,7 @@ public PagedIterable listByDeviceGroup( /** * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not * belong to a device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -421,19 +343,15 @@ public PagedIterable listByDeviceGroup( * @return a Device along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName) { + private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -454,27 +372,16 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + deviceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not * belong to a device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -487,24 +394,15 @@ private Mono> getWithResponseAsync( * @return a Device along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -525,24 +423,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, productName, deviceGroupName, deviceName, accept, context); } /** * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not * belong to a device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -554,8 +442,8 @@ private Mono> getWithResponseAsync( * @return a Device on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName) { + private Mono getAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName) { return getWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -563,7 +451,7 @@ private Mono getAsync( /** * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not * belong to a device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -576,13 +464,8 @@ private Mono getAsync( * @return a Device along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - Context context) { + public Response getWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, Context context) { return getWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context) .block(); } @@ -590,7 +473,7 @@ public Response getWithResponse( /** * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not * belong to a device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -602,8 +485,8 @@ public Response getWithResponse( * @return a Device. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceInner get( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName) { + public DeviceInner get(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName) { return getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, Context.NONE) .getValue(); } @@ -611,7 +494,7 @@ public DeviceInner get( /** * Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the * catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -622,27 +505,18 @@ public DeviceInner get( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an device resource belonging to a device group resource along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceInner resource) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deviceName, DeviceInner resource) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -668,28 +542,16 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - resource, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + deviceName, resource, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the * catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -701,28 +563,19 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an device resource belonging to a device group resource along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceInner resource, + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deviceName, DeviceInner resource, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -748,25 +601,15 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - resource, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + resource, accept, context); } /** * Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the * catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -779,26 +622,18 @@ private Mono>> createOrUpdateWithResponseAsync( * @return the {@link PollerFlux} for polling of an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeviceInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceInner resource) { - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deviceName, resource); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DeviceInner.class, DeviceInner.class, this.client.getContext()); + private PollerFlux, DeviceInner> beginCreateOrUpdateAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deviceName, DeviceInner resource) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, + productName, deviceGroupName, deviceName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DeviceInner.class, DeviceInner.class, this.client.getContext()); } /** * Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the * catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -812,28 +647,20 @@ private PollerFlux, DeviceInner> beginCreateOrUpdateAsyn * @return the {@link PollerFlux} for polling of an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeviceInner> beginCreateOrUpdateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceInner resource, + private PollerFlux, DeviceInner> beginCreateOrUpdateAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deviceName, DeviceInner resource, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deviceName, resource, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DeviceInner.class, DeviceInner.class, context); + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, + productName, deviceGroupName, deviceName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DeviceInner.class, DeviceInner.class, context); } /** * Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the * catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -846,23 +673,16 @@ private PollerFlux, DeviceInner> beginCreateOrUpdateAsyn * @return the {@link SyncPoller} for polling of an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeviceInner> beginCreateOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceInner resource) { - return this - .beginCreateOrUpdateAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deviceName, resource) - .getSyncPoller(); + public SyncPoller, DeviceInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deviceName, DeviceInner resource) { + return this.beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + resource).getSyncPoller(); } /** * Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the * catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -876,24 +696,17 @@ public SyncPoller, DeviceInner> beginCreateOrUpdate( * @return the {@link SyncPoller} for polling of an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeviceInner> beginCreateOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceInner resource, + public SyncPoller, DeviceInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deviceName, DeviceInner resource, Context context) { - return this - .beginCreateOrUpdateAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deviceName, resource, context) - .getSyncPoller(); + return this.beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + resource, context).getSyncPoller(); } /** * Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the * catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -906,23 +719,16 @@ public SyncPoller, DeviceInner> beginCreateOrUpdate( * @return an device resource belonging to a device group resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceInner resource) { - return beginCreateOrUpdateAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deviceName, resource) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, DeviceInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + resource).last().flatMap(this.client::getLroFinalResultOrError); } /** * Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the * catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -936,24 +742,16 @@ private Mono createOrUpdateAsync( * @return an device resource belonging to a device group resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceInner resource, - Context context) { - return beginCreateOrUpdateAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deviceName, resource, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, DeviceInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + resource, context).last().flatMap(this.client::getLroFinalResultOrError); } /** * Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the * catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -966,13 +764,8 @@ private Mono createOrUpdateAsync( * @return an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceInner createOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceInner resource) { + public DeviceInner createOrUpdate(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, DeviceInner resource) { return createOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, resource) .block(); } @@ -980,7 +773,7 @@ public DeviceInner createOrUpdate( /** * Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the * catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -994,23 +787,16 @@ public DeviceInner createOrUpdate( * @return an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceInner createOrUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceInner resource, - Context context) { - return createOrUpdateAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deviceName, resource, context) - .block(); + public DeviceInner createOrUpdate(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, DeviceInner resource, Context context) { + return createOrUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, resource, + context).block(); } /** * Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the * catalog level. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1021,27 +807,18 @@ public DeviceInner createOrUpdate( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an device resource belonging to a device group resource along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceUpdate properties) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, DeviceUpdate properties) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1067,28 +844,16 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - properties, - accept, - context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + deviceName, properties, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the * catalog level. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1100,28 +865,18 @@ private Mono>> updateWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an device resource belonging to a device group resource along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceUpdate properties, - Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, DeviceUpdate properties, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1147,25 +902,14 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - properties, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties, accept, context); } /** * Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the * catalog level. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1178,26 +922,18 @@ private Mono>> updateWithResponseAsync( * @return the {@link PollerFlux} for polling of an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeviceInner> beginUpdateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceUpdate properties) { - Mono>> mono = - updateWithResponseAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DeviceInner.class, DeviceInner.class, this.client.getContext()); + private PollerFlux, DeviceInner> beginUpdateAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deviceName, DeviceUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, catalogName, productName, + deviceGroupName, deviceName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DeviceInner.class, DeviceInner.class, this.client.getContext()); } /** * Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the * catalog level. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1211,28 +947,20 @@ private PollerFlux, DeviceInner> beginUpdateAsync( * @return the {@link PollerFlux} for polling of an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DeviceInner> beginUpdateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceUpdate properties, + private PollerFlux, DeviceInner> beginUpdateAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deviceName, DeviceUpdate properties, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), DeviceInner.class, DeviceInner.class, context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, catalogName, productName, + deviceGroupName, deviceName, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + DeviceInner.class, DeviceInner.class, context); } /** * Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the * catalog level. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1245,13 +973,8 @@ private PollerFlux, DeviceInner> beginUpdateAsync( * @return the {@link SyncPoller} for polling of an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeviceInner> beginUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceUpdate properties) { + public SyncPoller, DeviceInner> beginUpdate(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, DeviceUpdate properties) { return this .beginUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties) .getSyncPoller(); @@ -1260,7 +983,7 @@ public SyncPoller, DeviceInner> beginUpdate( /** * Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the * catalog level. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1274,24 +997,16 @@ public SyncPoller, DeviceInner> beginUpdate( * @return the {@link SyncPoller} for polling of an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DeviceInner> beginUpdate( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceUpdate properties, - Context context) { - return this - .beginUpdateAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties, context) - .getSyncPoller(); + public SyncPoller, DeviceInner> beginUpdate(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, DeviceUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + properties, context).getSyncPoller(); } /** * Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the * catalog level. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1304,22 +1019,16 @@ public SyncPoller, DeviceInner> beginUpdate( * @return an device resource belonging to a device group resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceUpdate properties) { + private Mono updateAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, DeviceUpdate properties) { return beginUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties) - .last() - .flatMap(this.client::getLroFinalResultOrError); + .last().flatMap(this.client::getLroFinalResultOrError); } /** * Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the * catalog level. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1333,24 +1042,16 @@ private Mono updateAsync( * @return an device resource belonging to a device group resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceUpdate properties, - Context context) { - return beginUpdateAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono updateAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, DeviceUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties, + context).last().flatMap(this.client::getLroFinalResultOrError); } /** * Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the * catalog level. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1363,13 +1064,8 @@ private Mono updateAsync( * @return an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceInner update( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceUpdate properties) { + public DeviceInner update(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName, DeviceUpdate properties) { return updateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties) .block(); } @@ -1377,7 +1073,7 @@ public DeviceInner update( /** * Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the * catalog level. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1391,22 +1087,15 @@ public DeviceInner update( * @return an device resource belonging to a device group resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceInner update( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - DeviceUpdate properties, - Context context) { - return updateAsync( - resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties, context) - .block(); + public DeviceInner update(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName, DeviceUpdate properties, Context context) { + return updateAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, properties, + context).block(); } /** * Delete a Device. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1418,19 +1107,15 @@ public DeviceInner update( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1451,26 +1136,15 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, + deviceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete a Device. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1483,24 +1157,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1521,23 +1186,13 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, productName, deviceGroupName, deviceName, accept, context); } /** * Delete a Device. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1549,19 +1204,17 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Delete a Device. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1574,24 +1227,18 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, catalogName, productName, + deviceGroupName, deviceName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Delete a Device. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1603,16 +1250,15 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName) { - return this - .beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName) + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName) { + return this.beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName) .getSyncPoller(); } /** * Delete a Device. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1625,21 +1271,15 @@ public SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - Context context) { - return this - .beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context) + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, Context context) { + return this.beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context) .getSyncPoller(); } /** * Delete a Device. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1651,16 +1291,15 @@ public SyncPoller, Void> beginDelete( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName) { - return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName) - .last() + private Mono deleteAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName) { + return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete a Device. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1673,21 +1312,15 @@ private Mono deleteAsync( * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - Context context) { + private Mono deleteAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, Context context) { return beginDeleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + .last().flatMap(this.client::getLroFinalResultOrError); } /** * Delete a Device. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1698,14 +1331,14 @@ private Mono deleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName) { + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName) { deleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName).block(); } /** * Delete a Device. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1717,20 +1350,15 @@ public void delete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - Context context) { + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName, Context context) { deleteAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context).block(); } /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product * names to generate the image for a device that does not belong to a specific device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1740,28 +1368,20 @@ public void 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 signed device capability image response along with {@link Response} on successful completion of {@link - * Mono}. + * @return signed device capability image response along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> generateCapabilityImageWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, + private Mono>> generateCapabilityImageWithResponseAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1781,37 +1401,23 @@ private Mono>> generateCapabilityImageWithResponseAsyn return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); } if (generateDeviceCapabilityRequest == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter generateDeviceCapabilityRequest is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter generateDeviceCapabilityRequest is required and cannot be null.")); } else { generateDeviceCapabilityRequest.validate(); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .generateCapabilityImage( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - generateDeviceCapabilityRequest, - accept, - context)) + .withContext(context -> service.generateCapabilityImage(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, catalogName, + productName, deviceGroupName, deviceName, generateDeviceCapabilityRequest, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product * names to generate the image for a device that does not belong to a specific device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1822,29 +1428,20 @@ private Mono>> generateCapabilityImageWithResponseAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return signed device capability image response along with {@link Response} on successful completion of {@link - * Mono}. + * @return signed device capability image response along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> generateCapabilityImageWithResponseAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - GenerateCapabilityImageRequest generateDeviceCapabilityRequest, - Context context) { + private Mono>> generateCapabilityImageWithResponseAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deviceName, + GenerateCapabilityImageRequest generateDeviceCapabilityRequest, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1864,34 +1461,22 @@ private Mono>> generateCapabilityImageWithResponseAsyn return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null.")); } if (generateDeviceCapabilityRequest == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter generateDeviceCapabilityRequest is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter generateDeviceCapabilityRequest is required and cannot be null.")); } else { generateDeviceCapabilityRequest.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .generateCapabilityImage( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - generateDeviceCapabilityRequest, - accept, - context); + return service.generateCapabilityImage(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + generateDeviceCapabilityRequest, accept, context); } /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product * names to generate the image for a device that does not belong to a specific device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1905,35 +1490,19 @@ private Mono>> generateCapabilityImageWithResponseAsyn */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SignedCapabilityImageResponseInner> - beginGenerateCapabilityImageAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - GenerateCapabilityImageRequest generateDeviceCapabilityRequest) { - Mono>> mono = - generateCapabilityImageWithResponseAsync( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - generateDeviceCapabilityRequest); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SignedCapabilityImageResponseInner.class, - SignedCapabilityImageResponseInner.class, - this.client.getContext()); + beginGenerateCapabilityImageAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest) { + Mono>> mono = generateCapabilityImageWithResponseAsync(resourceGroupName, catalogName, + productName, deviceGroupName, deviceName, generateDeviceCapabilityRequest); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SignedCapabilityImageResponseInner.class, + SignedCapabilityImageResponseInner.class, this.client.getContext()); } /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product * names to generate the image for a device that does not belong to a specific device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1948,38 +1517,21 @@ private Mono>> generateCapabilityImageWithResponseAsyn */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SignedCapabilityImageResponseInner> - beginGenerateCapabilityImageAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - GenerateCapabilityImageRequest generateDeviceCapabilityRequest, + beginGenerateCapabilityImageAsync(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - generateCapabilityImageWithResponseAsync( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - generateDeviceCapabilityRequest, - context); - return this - .client - .getLroResult( - mono, - this.client.getHttpPipeline(), - SignedCapabilityImageResponseInner.class, - SignedCapabilityImageResponseInner.class, - context); + Mono>> mono = generateCapabilityImageWithResponseAsync(resourceGroupName, catalogName, + productName, deviceGroupName, deviceName, generateDeviceCapabilityRequest, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SignedCapabilityImageResponseInner.class, + SignedCapabilityImageResponseInner.class, context); } /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product * names to generate the image for a device that does not belong to a specific device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1993,28 +1545,16 @@ private Mono>> generateCapabilityImageWithResponseAsyn */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SignedCapabilityImageResponseInner> - beginGenerateCapabilityImage( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - GenerateCapabilityImageRequest generateDeviceCapabilityRequest) { - return this - .beginGenerateCapabilityImageAsync( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - generateDeviceCapabilityRequest) - .getSyncPoller(); + beginGenerateCapabilityImage(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest) { + return this.beginGenerateCapabilityImageAsync(resourceGroupName, catalogName, productName, deviceGroupName, + deviceName, generateDeviceCapabilityRequest).getSyncPoller(); } /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product * names to generate the image for a device that does not belong to a specific device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -2029,30 +1569,17 @@ private Mono>> generateCapabilityImageWithResponseAsyn */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SignedCapabilityImageResponseInner> - beginGenerateCapabilityImage( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - GenerateCapabilityImageRequest generateDeviceCapabilityRequest, + beginGenerateCapabilityImage(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest, Context context) { - return this - .beginGenerateCapabilityImageAsync( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - generateDeviceCapabilityRequest, - context) - .getSyncPoller(); + return this.beginGenerateCapabilityImageAsync(resourceGroupName, catalogName, productName, deviceGroupName, + deviceName, generateDeviceCapabilityRequest, context).getSyncPoller(); } /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product * names to generate the image for a device that does not belong to a specific device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -2065,28 +1592,17 @@ private Mono>> generateCapabilityImageWithResponseAsyn * @return signed device capability image response on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono generateCapabilityImageAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, + private Mono generateCapabilityImageAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest) { - return beginGenerateCapabilityImageAsync( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - generateDeviceCapabilityRequest) - .last() - .flatMap(this.client::getLroFinalResultOrError); + return beginGenerateCapabilityImageAsync(resourceGroupName, catalogName, productName, deviceGroupName, + deviceName, generateDeviceCapabilityRequest).last().flatMap(this.client::getLroFinalResultOrError); } /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product * names to generate the image for a device that does not belong to a specific device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -2100,30 +1616,17 @@ private Mono generateCapabilityImageAsync( * @return signed device capability image response on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono generateCapabilityImageAsync( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - GenerateCapabilityImageRequest generateDeviceCapabilityRequest, - Context context) { - return beginGenerateCapabilityImageAsync( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - generateDeviceCapabilityRequest, - context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono generateCapabilityImageAsync(String resourceGroupName, + String catalogName, String productName, String deviceGroupName, String deviceName, + GenerateCapabilityImageRequest generateDeviceCapabilityRequest, Context context) { + return beginGenerateCapabilityImageAsync(resourceGroupName, catalogName, productName, deviceGroupName, + deviceName, generateDeviceCapabilityRequest, context).last().flatMap(this.client::getLroFinalResultOrError); } /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product * names to generate the image for a device that does not belong to a specific device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -2136,27 +1639,17 @@ private Mono generateCapabilityImageAsync( * @return signed device capability image response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SignedCapabilityImageResponseInner generateCapabilityImage( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, + public SignedCapabilityImageResponseInner generateCapabilityImage(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest) { - return generateCapabilityImageAsync( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - generateDeviceCapabilityRequest) - .block(); + return generateCapabilityImageAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + generateDeviceCapabilityRequest).block(); } /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product * names to generate the image for a device that does not belong to a specific device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -2170,35 +1663,24 @@ public SignedCapabilityImageResponseInner generateCapabilityImage( * @return signed device capability image response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SignedCapabilityImageResponseInner generateCapabilityImage( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - GenerateCapabilityImageRequest generateDeviceCapabilityRequest, - Context context) { - return generateCapabilityImageAsync( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - generateDeviceCapabilityRequest, - context) - .block(); + public SignedCapabilityImageResponseInner generateCapabilityImage(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, + GenerateCapabilityImageRequest generateDeviceCapabilityRequest, Context context) { + return generateCapabilityImageAsync(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, + generateDeviceCapabilityRequest, context).block(); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 a Device list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByDeviceGroupNextSinglePageAsync(String nextLink) { @@ -2206,37 +1688,29 @@ private Mono> listByDeviceGroupNextSinglePageAsync(St return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByDeviceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 a Device list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByDeviceGroupNextSinglePageAsync(String nextLink, Context context) { @@ -2244,23 +1718,13 @@ private Mono> listByDeviceGroupNextSinglePageAsync(St return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByDeviceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByDeviceGroupNext(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/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DevicesImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DevicesImpl.java index 2da011f018f7c..9c9fd2a75d7e2 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DevicesImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/DevicesImpl.java @@ -29,48 +29,36 @@ public DevicesImpl(DevicesClient innerClient, com.azure.resourcemanager.sphere.A this.serviceManager = serviceManager; } - public PagedIterable listByDeviceGroup( - String resourceGroupName, String catalogName, String productName, String deviceGroupName) { - PagedIterable inner = - this.serviceClient().listByDeviceGroup(resourceGroupName, catalogName, productName, deviceGroupName); - return Utils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); + public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName) { + PagedIterable inner + = this.serviceClient().listByDeviceGroup(resourceGroupName, catalogName, productName, deviceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); } - public PagedIterable listByDeviceGroup( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context) { - PagedIterable inner = - this - .serviceClient() - .listByDeviceGroup(resourceGroupName, catalogName, productName, deviceGroupName, context); - return Utils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); + public PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByDeviceGroup(resourceGroupName, catalogName, + productName, deviceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context); + public Response getWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, Context context) { + Response inner = this.serviceClient().getWithResponse(resourceGroupName, catalogName, productName, + deviceGroupName, deviceName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new DeviceImpl(inner.getValue(), this.manager())); } else { return null; } } - public Device get( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName) { - DeviceInner inner = - this.serviceClient().get(resourceGroupName, catalogName, productName, deviceGroupName, deviceName); + public Device get(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName) { + DeviceInner inner + = this.serviceClient().get(resourceGroupName, catalogName, productName, deviceGroupName, deviceName); if (inner != null) { return new DeviceImpl(inner, this.manager()); } else { @@ -78,38 +66,21 @@ public Device get( } } - public void delete( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName) { + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName) { this.serviceClient().delete(resourceGroupName, catalogName, productName, deviceGroupName, deviceName); } - public void delete( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - Context context) { + public void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName, Context context) { this.serviceClient().delete(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context); } - public SignedCapabilityImageResponse generateCapabilityImage( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, + public SignedCapabilityImageResponse generateCapabilityImage(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest) { - SignedCapabilityImageResponseInner inner = - this - .serviceClient() - .generateCapabilityImage( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - generateDeviceCapabilityRequest); + SignedCapabilityImageResponseInner inner = this.serviceClient().generateCapabilityImage(resourceGroupName, + catalogName, productName, deviceGroupName, deviceName, generateDeviceCapabilityRequest); if (inner != null) { return new SignedCapabilityImageResponseImpl(inner, this.manager()); } else { @@ -117,25 +88,11 @@ public SignedCapabilityImageResponse generateCapabilityImage( } } - public SignedCapabilityImageResponse generateCapabilityImage( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - GenerateCapabilityImageRequest generateDeviceCapabilityRequest, - Context context) { - SignedCapabilityImageResponseInner inner = - this - .serviceClient() - .generateCapabilityImage( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - generateDeviceCapabilityRequest, - context); + public SignedCapabilityImageResponse generateCapabilityImage(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, + GenerateCapabilityImageRequest generateDeviceCapabilityRequest, Context context) { + SignedCapabilityImageResponseInner inner = this.serviceClient().generateCapabilityImage(resourceGroupName, + catalogName, productName, deviceGroupName, deviceName, generateDeviceCapabilityRequest, context); if (inner != null) { return new SignedCapabilityImageResponseImpl(inner, this.manager()); } else { @@ -144,41 +101,30 @@ public SignedCapabilityImageResponse generateCapabilityImage( } public Device getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String productName = Utils.getValueFromIdByName(id, "products"); + String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); if (productName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); } - String deviceGroupName = Utils.getValueFromIdByName(id, "deviceGroups"); + String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); if (deviceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); } - String deviceName = Utils.getValueFromIdByName(id, "devices"); + String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "devices"); if (deviceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); } return this .getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, Context.NONE) @@ -186,121 +132,88 @@ public Device getById(String id) { } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String productName = Utils.getValueFromIdByName(id, "products"); + String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); if (productName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); } - String deviceGroupName = Utils.getValueFromIdByName(id, "deviceGroups"); + String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); if (deviceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); } - String deviceName = Utils.getValueFromIdByName(id, "devices"); + String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "devices"); if (deviceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); } return this.getWithResponse(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String productName = Utils.getValueFromIdByName(id, "products"); + String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); if (productName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); } - String deviceGroupName = Utils.getValueFromIdByName(id, "deviceGroups"); + String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); if (deviceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); } - String deviceName = Utils.getValueFromIdByName(id, "devices"); + String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "devices"); if (deviceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); } this.delete(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String productName = Utils.getValueFromIdByName(id, "products"); + String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); if (productName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); } - String deviceGroupName = Utils.getValueFromIdByName(id, "deviceGroups"); + String deviceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "deviceGroups"); if (deviceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'deviceGroups'.", id))); } - String deviceName = Utils.getValueFromIdByName(id, "devices"); + String deviceName = ResourceManagerUtils.getValueFromIdByName(id, "devices"); if (deviceName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'devices'.", id))); } this.delete(resourceGroupName, catalogName, productName, deviceGroupName, deviceName, context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImageImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImageImpl.java index a1d69b14dd2ab..07aad183addee 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImageImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImageImpl.java @@ -4,12 +4,11 @@ package com.azure.resourcemanager.sphere.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.sphere.fluent.models.ImageInner; import com.azure.resourcemanager.sphere.models.Image; -import com.azure.resourcemanager.sphere.models.ImageType; -import com.azure.resourcemanager.sphere.models.ProvisioningState; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; +import com.azure.resourcemanager.sphere.models.ImageProperties; public final class ImageImpl implements Image, Image.Definition, Image.Update { private ImageInner innerObject; @@ -28,40 +27,12 @@ public String type() { return this.innerModel().type(); } - public String image() { - return this.innerModel().image(); + public ImageProperties properties() { + return this.innerModel().properties(); } - public String imageId() { - return this.innerModel().imageId(); - } - - public String imageName() { - return this.innerModel().imageName(); - } - - public RegionalDataBoundary regionalDataBoundary() { - return this.innerModel().regionalDataBoundary(); - } - - public String uri() { - return this.innerModel().uri(); - } - - public String description() { - return this.innerModel().description(); - } - - public String componentId() { - return this.innerModel().componentId(); - } - - public ImageType imageType() { - return this.innerModel().imageType(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -89,20 +60,14 @@ public ImageImpl withExistingCatalog(String resourceGroupName, String catalogNam } public Image create() { - this.innerObject = - serviceManager - .serviceClient() - .getImages() - .createOrUpdate(resourceGroupName, catalogName, imageName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient().getImages().createOrUpdate(resourceGroupName, catalogName, + imageName, this.innerModel(), Context.NONE); return this; } public Image create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getImages() - .createOrUpdate(resourceGroupName, catalogName, imageName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient().getImages().createOrUpdate(resourceGroupName, catalogName, + imageName, this.innerModel(), context); return this; } @@ -117,63 +82,39 @@ public ImageImpl update() { } public Image apply() { - this.innerObject = - serviceManager - .serviceClient() - .getImages() - .createOrUpdate(resourceGroupName, catalogName, imageName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient().getImages().createOrUpdate(resourceGroupName, catalogName, + imageName, this.innerModel(), Context.NONE); return this; } public Image apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getImages() - .createOrUpdate(resourceGroupName, catalogName, imageName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient().getImages().createOrUpdate(resourceGroupName, catalogName, + imageName, this.innerModel(), context); return this; } ImageImpl(ImageInner innerObject, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.catalogName = Utils.getValueFromIdByName(innerObject.id(), "catalogs"); - this.imageName = Utils.getValueFromIdByName(innerObject.id(), "images"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.catalogName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "catalogs"); + this.imageName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "images"); } public Image refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getImages() - .getWithResponse(resourceGroupName, catalogName, imageName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getImages() + .getWithResponse(resourceGroupName, catalogName, imageName, Context.NONE).getValue(); return this; } public Image refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getImages() - .getWithResponse(resourceGroupName, catalogName, imageName, context) - .getValue(); - return this; - } - - public ImageImpl withImage(String image) { - this.innerModel().withImage(image); - return this; - } - - public ImageImpl withImageId(String imageId) { - this.innerModel().withImageId(imageId); + this.innerObject = serviceManager.serviceClient().getImages() + .getWithResponse(resourceGroupName, catalogName, imageName, context).getValue(); return this; } - public ImageImpl withRegionalDataBoundary(RegionalDataBoundary regionalDataBoundary) { - this.innerModel().withRegionalDataBoundary(regionalDataBoundary); + public ImageImpl withProperties(ImageProperties properties) { + this.innerModel().withProperties(properties); return this; } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImagesClientImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImagesClientImpl.java index fa5d3497afd07..c6c1aa74e5aec 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImagesClientImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImagesClientImpl.java @@ -38,109 +38,88 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ImagesClient. */ +/** + * An instance of this class provides access to all the operations defined in ImagesClient. + */ public final class ImagesClientImpl implements ImagesClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ImagesService service; - /** The service client containing this operation class. */ - private final AzureSphereManagementClientImpl client; + /** + * The service client containing this operation class. + */ + private final AzureSphereMgmtClientImpl client; /** * Initializes an instance of ImagesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - ImagesClientImpl(AzureSphereManagementClientImpl client) { + ImagesClientImpl(AzureSphereMgmtClientImpl client) { this.service = RestProxy.create(ImagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureSphereManagementClientImages to be used by the proxy service to + * The interface defining all the services for AzureSphereMgmtClientImages to be used by the proxy service to * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "AzureSphereManagemen") + @ServiceInterface(name = "AzureSphereMgmtClien") public interface ImagesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCatalog( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @QueryParam("$skip") Integer skip, - @QueryParam("$maxpagesize") Integer maxpagesize, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}") - @ExpectedResponses({200}) + Mono> listByCatalog(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @QueryParam("$top") Integer top, @QueryParam("$skip") Integer skip, + @QueryParam("$maxpagesize") Integer maxpagesize, @PathParam("catalogName") String catalogName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}") + @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("catalogName") String catalogName, - @PathParam("imageName") String imageName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}") - @ExpectedResponses({200, 201}) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("imageName") String imageName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}") + @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("catalogName") String catalogName, - @PathParam("imageName") String imageName, - @BodyParam("application/json") ImageInner resource, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}") - @ExpectedResponses({200, 202, 204}) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("imageName") String imageName, @BodyParam("application/json") ImageInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}") + @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("catalogName") String catalogName, - @PathParam("imageName") String imageName, - @HeaderParam("Accept") String accept, - Context context); + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("imageName") String imageName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByCatalogNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List Image resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -151,22 +130,18 @@ Mono> listByCatalogNext( * @throws ManagementException thrown 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 a Image list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCatalogSinglePageAsync( - String resourceGroupName, String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize) { + private Mono> listByCatalogSinglePageAsync(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -177,36 +152,17 @@ private Mono> listByCatalogSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByCatalog( - this.client.getEndpoint(), - filter, - top, - skip, - maxpagesize, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByCatalog(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, top, skip, maxpagesize, catalogName, accept, + context)) + .>map(res -> new 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 Image resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -218,28 +174,18 @@ private Mono> listByCatalogSinglePageAsync( * @throws ManagementException thrown 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 a Image list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCatalogSinglePageAsync( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { + private Mono> listByCatalogSinglePageAsync(String resourceGroupName, String catalogName, + String filter, Integer top, Integer skip, Integer maxpagesize, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -251,32 +197,15 @@ private Mono> listByCatalogSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByCatalog( - this.client.getEndpoint(), - filter, - top, - skip, - maxpagesize, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByCatalog(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, filter, top, skip, maxpagesize, catalogName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List Image resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -289,8 +218,8 @@ private Mono> listByCatalogSinglePageAsync( * @return the response of a Image list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCatalogAsync( - String resourceGroupName, String catalogName, String filter, Integer top, Integer skip, Integer maxpagesize) { + private PagedFlux listByCatalogAsync(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize) { return new PagedFlux<>( () -> listByCatalogSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize), nextLink -> listByCatalogNextSinglePageAsync(nextLink)); @@ -298,7 +227,7 @@ private PagedFlux listByCatalogAsync( /** * List Image resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -319,7 +248,7 @@ private PagedFlux listByCatalogAsync(String resourceGroupName, Strin /** * List Image resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -333,14 +262,8 @@ private PagedFlux listByCatalogAsync(String resourceGroupName, Strin * @return the response of a Image list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByCatalogAsync( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { + private PagedFlux listByCatalogAsync(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context) { return new PagedFlux<>( () -> listByCatalogSinglePageAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context), nextLink -> listByCatalogNextSinglePageAsync(nextLink, context)); @@ -348,7 +271,7 @@ private PagedFlux listByCatalogAsync( /** * List Image resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -367,7 +290,7 @@ public PagedIterable listByCatalog(String resourceGroupName, String /** * List Image resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -381,43 +304,33 @@ public PagedIterable listByCatalog(String resourceGroupName, String * @return the response of a Image list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByCatalog( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { + public PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context) { return new PagedIterable<>( listByCatalogAsync(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context)); } /** * Get a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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 a Image along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String catalogName, String imageName) { + private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, + String imageName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -431,27 +344,17 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - imageName, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, imageName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -459,19 +362,15 @@ private Mono> getWithResponseAsync( * @return a Image along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String catalogName, String imageName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, + String imageName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -485,24 +384,16 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - imageName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, imageName, accept, context); } /** * Get a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -516,10 +407,10 @@ private Mono getAsync(String resourceGroupName, String catalogName, /** * Get a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -527,17 +418,17 @@ private Mono getAsync(String resourceGroupName, String catalogName, * @return a Image along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String catalogName, String imageName, Context context) { + public Response getWithResponse(String resourceGroupName, String catalogName, String imageName, + Context context) { return getWithResponseAsync(resourceGroupName, catalogName, imageName, context).block(); } /** * Get a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -550,31 +441,27 @@ public ImageInner get(String resourceGroupName, String catalogName, String image /** * Create a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the API. * @param resource Resource create 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 an image resource belonging to a catalog resource along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String catalogName, String imageName, ImageInner resource) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String catalogName, String imageName, ImageInner resource) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -593,50 +480,35 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - imageName, - resource, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, imageName, resource, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the API. * @param resource Resource create 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 an image resource belonging to a catalog resource along with {@link Response} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String catalogName, String imageName, ImageInner resource, Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String catalogName, String imageName, ImageInner resource, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -655,25 +527,16 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - imageName, - resource, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, imageName, resource, accept, context); } /** * Create a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the API. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -681,22 +544,20 @@ private Mono>> createOrUpdateWithResponseAsync( * @return the {@link PollerFlux} for polling of an image resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ImageInner> beginCreateOrUpdateAsync( - String resourceGroupName, String catalogName, String imageName, ImageInner resource) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, catalogName, imageName, resource); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ImageInner.class, ImageInner.class, this.client.getContext()); + private PollerFlux, ImageInner> beginCreateOrUpdateAsync(String resourceGroupName, + String catalogName, String imageName, ImageInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, imageName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), ImageInner.class, + ImageInner.class, this.client.getContext()); } /** * Create a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the API. * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -705,23 +566,21 @@ private PollerFlux, ImageInner> beginCreateOrUpdateAsync( * @return the {@link PollerFlux} for polling of an image resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ImageInner> beginCreateOrUpdateAsync( - String resourceGroupName, String catalogName, String imageName, ImageInner resource, Context context) { + private PollerFlux, ImageInner> beginCreateOrUpdateAsync(String resourceGroupName, + String catalogName, String imageName, ImageInner resource, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, catalogName, imageName, resource, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ImageInner.class, ImageInner.class, context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, imageName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), ImageInner.class, + ImageInner.class, context); } /** * Create a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the API. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -729,17 +588,17 @@ private PollerFlux, ImageInner> beginCreateOrUpdateAsync( * @return the {@link SyncPoller} for polling of an image resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ImageInner> beginCreateOrUpdate( - String resourceGroupName, String catalogName, String imageName, ImageInner resource) { + public SyncPoller, ImageInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, String imageName, ImageInner resource) { return this.beginCreateOrUpdateAsync(resourceGroupName, catalogName, imageName, resource).getSyncPoller(); } /** * Create a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the API. * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -748,19 +607,18 @@ public SyncPoller, ImageInner> beginCreateOrUpdate( * @return the {@link SyncPoller} for polling of an image resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ImageInner> beginCreateOrUpdate( - String resourceGroupName, String catalogName, String imageName, ImageInner resource, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, catalogName, imageName, resource, context) + public SyncPoller, ImageInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, String imageName, ImageInner resource, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, catalogName, imageName, resource, context) .getSyncPoller(); } /** * Create a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the API. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -768,19 +626,18 @@ public SyncPoller, ImageInner> beginCreateOrUpdate( * @return an image resource belonging to a catalog resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String catalogName, String imageName, ImageInner resource) { - return beginCreateOrUpdateAsync(resourceGroupName, catalogName, imageName, resource) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String imageName, + ImageInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, catalogName, imageName, resource).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the API. * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -789,19 +646,18 @@ private Mono createOrUpdateAsync( * @return an image resource belonging to a catalog resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String catalogName, String imageName, ImageInner resource, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, catalogName, imageName, resource, context) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String imageName, + ImageInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, catalogName, imageName, resource, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the API. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -809,17 +665,17 @@ private Mono createOrUpdateAsync( * @return an image resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner createOrUpdate( - String resourceGroupName, String catalogName, String imageName, ImageInner resource) { + public ImageInner createOrUpdate(String resourceGroupName, String catalogName, String imageName, + ImageInner resource) { return createOrUpdateAsync(resourceGroupName, catalogName, imageName, resource).block(); } /** * Create a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the API. * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -828,36 +684,32 @@ public ImageInner createOrUpdate( * @return an image resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ImageInner createOrUpdate( - String resourceGroupName, String catalogName, String imageName, ImageInner resource, Context context) { + public ImageInner createOrUpdate(String resourceGroupName, String catalogName, String imageName, + ImageInner resource, Context context) { return createOrUpdateAsync(resourceGroupName, catalogName, imageName, resource, context).block(); } /** * Delete a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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 {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String catalogName, String imageName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, + String imageName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -871,27 +723,17 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - imageName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, imageName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -899,19 +741,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String catalogName, String imageName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, + String imageName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -925,45 +763,35 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - imageName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, imageName, accept, context); } /** * Delete a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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 {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String catalogName, String imageName) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, + String imageName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, catalogName, imageName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Delete a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -971,39 +799,38 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String catalogName, String imageName, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, + String imageName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, catalogName, imageName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, catalogName, imageName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Delete a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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 {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String catalogName, String imageName) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + String imageName) { return this.beginDeleteAsync(resourceGroupName, catalogName, imageName).getSyncPoller(); } /** * Delete a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -1011,17 +838,17 @@ public SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String catalogName, String imageName, Context context) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + String imageName, Context context) { return this.beginDeleteAsync(resourceGroupName, catalogName, imageName, context).getSyncPoller(); } /** * Delete a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -1029,17 +856,16 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String catalogName, String imageName) { - return beginDeleteAsync(resourceGroupName, catalogName, imageName) - .last() + return beginDeleteAsync(resourceGroupName, catalogName, imageName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -1048,17 +874,16 @@ private Mono deleteAsync(String resourceGroupName, String catalogName, Str */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String catalogName, String imageName, Context context) { - return beginDeleteAsync(resourceGroupName, catalogName, imageName, context) - .last() + return beginDeleteAsync(resourceGroupName, catalogName, imageName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -1070,10 +895,10 @@ public void delete(String resourceGroupName, String catalogName, String imageNam /** * Delete a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -1086,14 +911,15 @@ public void delete(String resourceGroupName, String catalogName, String imageNam /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 a Image list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByCatalogNextSinglePageAsync(String nextLink) { @@ -1101,37 +927,29 @@ private Mono> listByCatalogNextSinglePageAsync(String return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByCatalogNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 a Image list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByCatalogNextSinglePageAsync(String nextLink, Context context) { @@ -1139,23 +957,13 @@ private Mono> listByCatalogNextSinglePageAsync(String return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByCatalogNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByCatalogNext(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/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImagesImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImagesImpl.java index 827d4f6b672f7..937e88be2d4be 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImagesImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ImagesImpl.java @@ -28,31 +28,22 @@ public ImagesImpl(ImagesClient innerClient, com.azure.resourcemanager.sphere.Azu public PagedIterable listByCatalog(String resourceGroupName, String catalogName) { PagedIterable inner = this.serviceClient().listByCatalog(resourceGroupName, catalogName); - return Utils.mapPage(inner, inner1 -> new ImageImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ImageImpl(inner1, this.manager())); } - public PagedIterable listByCatalog( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context) { - PagedIterable inner = - this.serviceClient().listByCatalog(resourceGroupName, catalogName, filter, top, skip, maxpagesize, context); - return Utils.mapPage(inner, inner1 -> new ImageImpl(inner1, this.manager())); + public PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, Integer top, + Integer skip, Integer maxpagesize, Context context) { + PagedIterable inner = this.serviceClient().listByCatalog(resourceGroupName, catalogName, filter, + top, skip, maxpagesize, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ImageImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, String catalogName, String imageName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, catalogName, imageName, context); + public Response getWithResponse(String resourceGroupName, String catalogName, String imageName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, catalogName, imageName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ImageImpl(inner.getValue(), this.manager())); } else { return null; @@ -77,105 +68,77 @@ public void delete(String resourceGroupName, String catalogName, String imageNam } public Image getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String imageName = Utils.getValueFromIdByName(id, "images"); + String imageName = ResourceManagerUtils.getValueFromIdByName(id, "images"); if (imageName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); } return this.getWithResponse(resourceGroupName, catalogName, imageName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String imageName = Utils.getValueFromIdByName(id, "images"); + String imageName = ResourceManagerUtils.getValueFromIdByName(id, "images"); if (imageName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); } return this.getWithResponse(resourceGroupName, catalogName, imageName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String imageName = Utils.getValueFromIdByName(id, "images"); + String imageName = ResourceManagerUtils.getValueFromIdByName(id, "images"); if (imageName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); } this.delete(resourceGroupName, catalogName, imageName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String imageName = Utils.getValueFromIdByName(id, "images"); + String imageName = ResourceManagerUtils.getValueFromIdByName(id, "images"); if (imageName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'images'.", id))); } this.delete(resourceGroupName, catalogName, imageName, context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationsClientImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationsClientImpl.java index ddee369b0405a..5ddb4fe50d7ca 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationsClientImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationsClientImpl.java @@ -30,125 +30,106 @@ import com.azure.resourcemanager.sphere.models.OperationListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final OperationsService service; - /** The service client containing this operation class. */ - private final AzureSphereManagementClientImpl client; + /** + * The service client containing this operation class. + */ + private final AzureSphereMgmtClientImpl client; /** * Initializes an instance of OperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(AzureSphereManagementClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + OperationsClientImpl(AzureSphereMgmtClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureSphereManagementClientOperations to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for AzureSphereMgmtClientOperations to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "AzureSphereManagemen") + @ServiceInterface(name = "AzureSphereMgmtClien") public interface OperationsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.AzureSphere/operations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * List the operations for the 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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * 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.")); + return 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)) + .>map(res -> new 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 operations for the 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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * 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.")); + return Mono.error( + 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)); + 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)); } /** * List the operations for the 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -157,27 +138,27 @@ private PagedFlux listAsync() { /** * List the operations for the 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List the operations for the 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -186,13 +167,13 @@ public PagedIterable list() { /** * List the operations for the 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -201,14 +182,15 @@ public PagedIterable list(Context context) { /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -216,37 +198,28 @@ private Mono> listNextSinglePageAsync(String nextL return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return 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)) + 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 URL to get the next list of items - *

The nextLink parameter. + * + * 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 REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -254,23 +227,13 @@ private Mono> listNextSinglePageAsync(String nextL return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + 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)); + 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/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationsImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationsImpl.java index 6ae70f0841532..c9356b30c78ae 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationsImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/OperationsImpl.java @@ -19,20 +19,20 @@ public final class OperationsImpl implements Operations { private final com.azure.resourcemanager.sphere.AzureSphereManager serviceManager; - public OperationsImpl( - OperationsClient innerClient, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductImpl.java index 26314d6c9732e..ff4bcdf5720fe 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductImpl.java @@ -6,13 +6,15 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.sphere.fluent.models.ProductInner; -import com.azure.resourcemanager.sphere.models.CountDeviceResponse; +import com.azure.resourcemanager.sphere.models.CountDevicesResponse; import com.azure.resourcemanager.sphere.models.DeviceGroup; import com.azure.resourcemanager.sphere.models.Product; +import com.azure.resourcemanager.sphere.models.ProductProperties; import com.azure.resourcemanager.sphere.models.ProductUpdate; -import com.azure.resourcemanager.sphere.models.ProvisioningState; +import com.azure.resourcemanager.sphere.models.ProductUpdateProperties; public final class ProductImpl implements Product, Product.Definition, Product.Update { private ProductInner innerObject; @@ -31,12 +33,12 @@ public String type() { return this.innerModel().type(); } - public String description() { - return this.innerModel().description(); + public ProductProperties properties() { + return this.innerModel().properties(); } - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public String resourceGroupName() { @@ -66,20 +68,14 @@ public ProductImpl withExistingCatalog(String resourceGroupName, String catalogN } public Product create() { - this.innerObject = - serviceManager - .serviceClient() - .getProducts() - .createOrUpdate(resourceGroupName, catalogName, productName, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient().getProducts().createOrUpdate(resourceGroupName, catalogName, + productName, this.innerModel(), Context.NONE); return this; } public Product create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getProducts() - .createOrUpdate(resourceGroupName, catalogName, productName, this.innerModel(), context); + this.innerObject = serviceManager.serviceClient().getProducts().createOrUpdate(resourceGroupName, catalogName, + productName, this.innerModel(), context); return this; } @@ -95,56 +91,42 @@ public ProductImpl update() { } public Product apply() { - this.innerObject = - serviceManager - .serviceClient() - .getProducts() - .update(resourceGroupName, catalogName, productName, updateProperties, Context.NONE); + this.innerObject = serviceManager.serviceClient().getProducts().update(resourceGroupName, catalogName, + productName, updateProperties, Context.NONE); return this; } public Product apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getProducts() - .update(resourceGroupName, catalogName, productName, updateProperties, context); + this.innerObject = serviceManager.serviceClient().getProducts().update(resourceGroupName, catalogName, + productName, updateProperties, context); return this; } ProductImpl(ProductInner innerObject, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.catalogName = Utils.getValueFromIdByName(innerObject.id(), "catalogs"); - this.productName = Utils.getValueFromIdByName(innerObject.id(), "products"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.catalogName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "catalogs"); + this.productName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "products"); } public Product refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getProducts() - .getWithResponse(resourceGroupName, catalogName, productName, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getProducts() + .getWithResponse(resourceGroupName, catalogName, productName, Context.NONE).getValue(); return this; } public Product refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getProducts() - .getWithResponse(resourceGroupName, catalogName, productName, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getProducts() + .getWithResponse(resourceGroupName, catalogName, productName, context).getValue(); return this; } - public Response countDevicesWithResponse(Context context) { + public Response countDevicesWithResponse(Context context) { return serviceManager.products().countDevicesWithResponse(resourceGroupName, catalogName, productName, context); } - public CountDeviceResponse countDevices() { + public CountDevicesResponse countDevices() { return serviceManager.products().countDevices(resourceGroupName, catalogName, productName); } @@ -153,22 +135,17 @@ public PagedIterable generateDefaultDeviceGroups() { } public PagedIterable generateDefaultDeviceGroups(Context context) { - return serviceManager - .products() - .generateDefaultDeviceGroups(resourceGroupName, catalogName, productName, context); + return serviceManager.products().generateDefaultDeviceGroups(resourceGroupName, catalogName, productName, + context); } - public ProductImpl withDescription(String description) { - if (isInCreateMode()) { - this.innerModel().withDescription(description); - return this; - } else { - this.updateProperties.withDescription(description); - return this; - } + public ProductImpl withProperties(ProductProperties properties) { + this.innerModel().withProperties(properties); + return this; } - private boolean isInCreateMode() { - return this.innerModel().id() == null; + public ProductImpl withProperties(ProductUpdateProperties properties) { + this.updateProperties.withProperties(properties); + return this; } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductsClientImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductsClientImpl.java index 1a9ea5f50753b..9034a2b7a033c 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductsClientImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductsClientImpl.java @@ -34,7 +34,7 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.sphere.fluent.ProductsClient; -import com.azure.resourcemanager.sphere.fluent.models.CountDeviceResponseInner; +import com.azure.resourcemanager.sphere.fluent.models.CountDevicesResponseInner; import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner; import com.azure.resourcemanager.sphere.fluent.models.ProductInner; import com.azure.resourcemanager.sphere.models.DeviceGroupListResult; @@ -44,183 +44,140 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ProductsClient. */ +/** + * An instance of this class provides access to all the operations defined in ProductsClient. + */ public final class ProductsClientImpl implements ProductsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ProductsService service; - /** The service client containing this operation class. */ - private final AzureSphereManagementClientImpl client; + /** + * The service client containing this operation class. + */ + private final AzureSphereMgmtClientImpl client; /** * Initializes an instance of ProductsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ - ProductsClientImpl(AzureSphereManagementClientImpl client) { + ProductsClientImpl(AzureSphereMgmtClientImpl client) { this.service = RestProxy.create(ProductsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for AzureSphereManagementClientProducts to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for AzureSphereMgmtClientProducts to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "AzureSphereManagemen") + @ServiceInterface(name = "AzureSphereMgmtClien") public interface ProductsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByCatalog( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}") - @ExpectedResponses({200}) + Mono> listByCatalog(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}") + @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("catalogName") String catalogName, - @PathParam("productName") String productName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}") - @ExpectedResponses({200, 201}) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}") + @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("catalogName") String catalogName, - @PathParam("productName") String productName, - @BodyParam("application/json") ProductInner resource, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}") - @ExpectedResponses({200, 202}) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @BodyParam("application/json") ProductInner resource, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @PathParam("productName") String productName, - @BodyParam("application/json") ProductUpdate properties, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}") - @ExpectedResponses({200, 202, 204}) + Mono>> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @BodyParam("application/json") ProductUpdate properties, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}") + @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("catalogName") String catalogName, - @PathParam("productName") String productName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/countDevices") - @ExpectedResponses({200}) + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/countDevices") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> countDevices( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @PathParam("productName") String productName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/generateDefaultDeviceGroups") - @ExpectedResponses({200}) + Mono> countDevices(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/generateDefaultDeviceGroups") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> generateDefaultDeviceGroups( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("catalogName") String catalogName, - @PathParam("productName") String productName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) + Mono> generateDefaultDeviceGroups(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("catalogName") String catalogName, + @PathParam("productName") String productName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByCatalogNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> generateDefaultDeviceGroupsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List Product resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 a Product list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCatalogSinglePageAsync( - String resourceGroupName, String catalogName) { + private Mono> listByCatalogSinglePageAsync(String resourceGroupName, + String catalogName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -231,32 +188,16 @@ private Mono> listByCatalogSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByCatalog( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByCatalog(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, accept, context)) + .>map(res -> new 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 Product resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -264,22 +205,18 @@ private Mono> listByCatalogSinglePageAsync( * @throws ManagementException thrown 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 a Product list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByCatalogSinglePageAsync( - String resourceGroupName, String catalogName, Context context) { + private Mono> listByCatalogSinglePageAsync(String resourceGroupName, String catalogName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -291,28 +228,15 @@ private Mono> listByCatalogSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByCatalog( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByCatalog(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List Product resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -322,14 +246,13 @@ private Mono> listByCatalogSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByCatalogAsync(String resourceGroupName, String catalogName) { - return new PagedFlux<>( - () -> listByCatalogSinglePageAsync(resourceGroupName, catalogName), + return new PagedFlux<>(() -> listByCatalogSinglePageAsync(resourceGroupName, catalogName), nextLink -> listByCatalogNextSinglePageAsync(nextLink)); } /** * List Product resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -340,14 +263,13 @@ private PagedFlux listByCatalogAsync(String resourceGroupName, Str */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByCatalogAsync(String resourceGroupName, String catalogName, Context context) { - return new PagedFlux<>( - () -> listByCatalogSinglePageAsync(resourceGroupName, catalogName, context), + return new PagedFlux<>(() -> listByCatalogSinglePageAsync(resourceGroupName, catalogName, context), nextLink -> listByCatalogNextSinglePageAsync(nextLink, context)); } /** * List Product resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -362,7 +284,7 @@ public PagedIterable listByCatalog(String resourceGroupName, Strin /** * List Product resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -378,7 +300,7 @@ public PagedIterable listByCatalog(String resourceGroupName, Strin /** * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -388,19 +310,15 @@ public PagedIterable listByCatalog(String resourceGroupName, Strin * @return a Product along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String catalogName, String productName) { + private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, + String productName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -414,24 +332,14 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -442,19 +350,15 @@ private Mono> getWithResponseAsync( * @return a Product along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String catalogName, String productName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String catalogName, + String productName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -468,21 +372,13 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, productName, accept, context); } /** * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -499,7 +395,7 @@ private Mono getAsync(String resourceGroupName, String catalogName /** * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -510,14 +406,14 @@ private Mono getAsync(String resourceGroupName, String catalogName * @return a Product along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String catalogName, String productName, Context context) { + public Response getWithResponse(String resourceGroupName, String catalogName, String productName, + Context context) { return getWithResponseAsync(resourceGroupName, catalogName, productName, context).block(); } /** * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -533,7 +429,7 @@ public ProductInner get(String resourceGroupName, String catalogName, String pro /** * Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -542,22 +438,18 @@ public ProductInner get(String resourceGroupName, String catalogName, String pro * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an product resource belonging to a catalog resource along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String catalogName, String productName, ProductInner resource) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String catalogName, String productName, ProductInner resource) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -576,25 +468,15 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - resource, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, resource, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -604,22 +486,18 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an product resource belonging to a catalog resource along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync( - String resourceGroupName, String catalogName, String productName, ProductInner resource, Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String catalogName, String productName, ProductInner resource, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -638,22 +516,13 @@ private Mono>> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - resource, - accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, resource, accept, context); } /** * Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -664,19 +533,17 @@ private Mono>> createOrUpdateWithResponseAsync( * @return the {@link PollerFlux} for polling of an product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProductInner> beginCreateOrUpdateAsync( - String resourceGroupName, String catalogName, String productName, ProductInner resource) { - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, catalogName, productName, resource); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ProductInner.class, ProductInner.class, this.client.getContext()); + private PollerFlux, ProductInner> beginCreateOrUpdateAsync(String resourceGroupName, + String catalogName, String productName, ProductInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, productName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProductInner.class, ProductInner.class, this.client.getContext()); } /** * Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -688,20 +555,18 @@ private PollerFlux, ProductInner> beginCreateOrUpdateAs * @return the {@link PollerFlux} for polling of an product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProductInner> beginCreateOrUpdateAsync( - String resourceGroupName, String catalogName, String productName, ProductInner resource, Context context) { + private PollerFlux, ProductInner> beginCreateOrUpdateAsync(String resourceGroupName, + String catalogName, String productName, ProductInner resource, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, catalogName, productName, resource, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ProductInner.class, ProductInner.class, context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, catalogName, productName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProductInner.class, ProductInner.class, context); } /** * Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -712,14 +577,14 @@ private PollerFlux, ProductInner> beginCreateOrUpdateAs * @return the {@link SyncPoller} for polling of an product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProductInner> beginCreateOrUpdate( - String resourceGroupName, String catalogName, String productName, ProductInner resource) { + public SyncPoller, ProductInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, String productName, ProductInner resource) { return this.beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, resource).getSyncPoller(); } /** * Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -731,16 +596,15 @@ public SyncPoller, ProductInner> beginCreateOrUpdate( * @return the {@link SyncPoller} for polling of an product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProductInner> beginCreateOrUpdate( - String resourceGroupName, String catalogName, String productName, ProductInner resource, Context context) { - return this - .beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, resource, context) + public SyncPoller, ProductInner> beginCreateOrUpdate(String resourceGroupName, + String catalogName, String productName, ProductInner resource, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, resource, context) .getSyncPoller(); } /** * Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -751,16 +615,15 @@ public SyncPoller, ProductInner> beginCreateOrUpdate( * @return an product resource belonging to a catalog resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String catalogName, String productName, ProductInner resource) { - return beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, resource) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String productName, + ProductInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, resource).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -772,16 +635,15 @@ private Mono createOrUpdateAsync( * @return an product resource belonging to a catalog resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String catalogName, String productName, ProductInner resource, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, resource, context) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String catalogName, String productName, + ProductInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, catalogName, productName, resource, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -792,14 +654,14 @@ private Mono createOrUpdateAsync( * @return an product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ProductInner createOrUpdate( - String resourceGroupName, String catalogName, String productName, ProductInner resource) { + public ProductInner createOrUpdate(String resourceGroupName, String catalogName, String productName, + ProductInner resource) { return createOrUpdateAsync(resourceGroupName, catalogName, productName, resource).block(); } /** * Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -811,14 +673,14 @@ public ProductInner createOrUpdate( * @return an product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ProductInner createOrUpdate( - String resourceGroupName, String catalogName, String productName, ProductInner resource, Context context) { + public ProductInner createOrUpdate(String resourceGroupName, String catalogName, String productName, + ProductInner resource, Context context) { return createOrUpdateAsync(resourceGroupName, catalogName, productName, resource, context).block(); } /** * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -827,22 +689,18 @@ public ProductInner createOrUpdate( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an product resource belonging to a catalog resource along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String catalogName, String productName, ProductUpdate properties) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String catalogName, + String productName, ProductUpdate properties) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -860,26 +718,14 @@ private Mono>> updateWithResponseAsync( properties.validate(); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - properties, - accept, - context)) + return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, properties, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -889,22 +735,18 @@ private Mono>> updateWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an product resource belonging to a catalog resource along with {@link Response} on successful completion - * of {@link Mono}. + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync( - String resourceGroupName, String catalogName, String productName, ProductUpdate properties, Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String catalogName, + String productName, ProductUpdate properties, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -923,22 +765,13 @@ private Mono>> updateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - properties, - accept, - context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, productName, properties, accept, context); } /** * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -949,19 +782,17 @@ private Mono>> updateWithResponseAsync( * @return the {@link PollerFlux} for polling of an product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProductInner> beginUpdateAsync( - String resourceGroupName, String catalogName, String productName, ProductUpdate properties) { - Mono>> mono = - updateWithResponseAsync(resourceGroupName, catalogName, productName, properties); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ProductInner.class, ProductInner.class, this.client.getContext()); + private PollerFlux, ProductInner> beginUpdateAsync(String resourceGroupName, + String catalogName, String productName, ProductUpdate properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, catalogName, productName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProductInner.class, ProductInner.class, this.client.getContext()); } /** * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -973,20 +804,18 @@ private PollerFlux, ProductInner> beginUpdateAsync( * @return the {@link PollerFlux} for polling of an product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ProductInner> beginUpdateAsync( - String resourceGroupName, String catalogName, String productName, ProductUpdate properties, Context context) { + private PollerFlux, ProductInner> beginUpdateAsync(String resourceGroupName, + String catalogName, String productName, ProductUpdate properties, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - updateWithResponseAsync(resourceGroupName, catalogName, productName, properties, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), ProductInner.class, ProductInner.class, context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, catalogName, productName, properties, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ProductInner.class, ProductInner.class, context); } /** * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -997,14 +826,14 @@ private PollerFlux, ProductInner> beginUpdateAsync( * @return the {@link SyncPoller} for polling of an product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProductInner> beginUpdate( - String resourceGroupName, String catalogName, String productName, ProductUpdate properties) { + public SyncPoller, ProductInner> beginUpdate(String resourceGroupName, String catalogName, + String productName, ProductUpdate properties) { return this.beginUpdateAsync(resourceGroupName, catalogName, productName, properties).getSyncPoller(); } /** * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1016,14 +845,14 @@ public SyncPoller, ProductInner> beginUpdate( * @return the {@link SyncPoller} for polling of an product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ProductInner> beginUpdate( - String resourceGroupName, String catalogName, String productName, ProductUpdate properties, Context context) { + public SyncPoller, ProductInner> beginUpdate(String resourceGroupName, String catalogName, + String productName, ProductUpdate properties, Context context) { return this.beginUpdateAsync(resourceGroupName, catalogName, productName, properties, context).getSyncPoller(); } /** * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1034,16 +863,15 @@ public SyncPoller, ProductInner> beginUpdate( * @return an product resource belonging to a catalog resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String catalogName, String productName, ProductUpdate properties) { - return beginUpdateAsync(resourceGroupName, catalogName, productName, properties) - .last() + private Mono updateAsync(String resourceGroupName, String catalogName, String productName, + ProductUpdate properties) { + return beginUpdateAsync(resourceGroupName, catalogName, productName, properties).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1055,16 +883,15 @@ private Mono updateAsync( * @return an product resource belonging to a catalog resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String catalogName, String productName, ProductUpdate properties, Context context) { - return beginUpdateAsync(resourceGroupName, catalogName, productName, properties, context) - .last() + private Mono updateAsync(String resourceGroupName, String catalogName, String productName, + ProductUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, catalogName, productName, properties, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1075,14 +902,14 @@ private Mono updateAsync( * @return an product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ProductInner update( - String resourceGroupName, String catalogName, String productName, ProductUpdate properties) { + public ProductInner update(String resourceGroupName, String catalogName, String productName, + ProductUpdate properties) { return updateAsync(resourceGroupName, catalogName, productName, properties).block(); } /** * Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1094,14 +921,14 @@ public ProductInner update( * @return an product resource belonging to a catalog resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ProductInner update( - String resourceGroupName, String catalogName, String productName, ProductUpdate properties, Context context) { + public ProductInner update(String resourceGroupName, String catalogName, String productName, + ProductUpdate properties, Context context) { return updateAsync(resourceGroupName, catalogName, productName, properties, context).block(); } /** * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1111,19 +938,15 @@ public ProductInner update( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String catalogName, String productName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, + String productName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1137,24 +960,14 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - accept, - context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1165,19 +978,15 @@ private Mono>> deleteWithResponseAsync( * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String catalogName, String productName, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String catalogName, + String productName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1191,21 +1000,13 @@ private Mono>> deleteWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - accept, - context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, catalogName, productName, accept, context); } /** * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1215,18 +1016,16 @@ private Mono>> deleteWithResponseAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String catalogName, String productName) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, + String productName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, catalogName, productName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1237,19 +1036,18 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String catalogName, String productName, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String catalogName, + String productName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, catalogName, productName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, catalogName, productName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1259,14 +1057,14 @@ private PollerFlux, Void> beginDeleteAsync( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String catalogName, String productName) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + String productName) { return this.beginDeleteAsync(resourceGroupName, catalogName, productName).getSyncPoller(); } /** * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1277,14 +1075,14 @@ public SyncPoller, Void> beginDelete( * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String catalogName, String productName, Context context) { + public SyncPoller, Void> beginDelete(String resourceGroupName, String catalogName, + String productName, Context context) { return this.beginDeleteAsync(resourceGroupName, catalogName, productName, context).getSyncPoller(); } /** * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1295,14 +1093,13 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String catalogName, String productName) { - return beginDeleteAsync(resourceGroupName, catalogName, productName) - .last() + return beginDeleteAsync(resourceGroupName, catalogName, productName).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1314,14 +1111,13 @@ private Mono deleteAsync(String resourceGroupName, String catalogName, Str */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String catalogName, String productName, Context context) { - return beginDeleteAsync(resourceGroupName, catalogName, productName, context) - .last() + return beginDeleteAsync(resourceGroupName, catalogName, productName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1336,7 +1132,7 @@ public void delete(String resourceGroupName, String catalogName, String productN /** * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1353,7 +1149,7 @@ public void delete(String resourceGroupName, String catalogName, String productN /** * Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product * name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1361,22 +1157,18 @@ public void delete(String resourceGroupName, String catalogName, String productN * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response to the action call for count devices in a catalog along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> countDevicesWithResponseAsync( - String resourceGroupName, String catalogName, String productName) { + private Mono> countDevicesWithResponseAsync(String resourceGroupName, + String catalogName, String productName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1390,25 +1182,15 @@ private Mono> countDevicesWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .countDevices( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - accept, - context)) + .withContext(context -> service.countDevices(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product * name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1417,22 +1199,18 @@ private Mono> countDevicesWithResponseAsync( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response to the action call for count devices in a catalog along with {@link Response} on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> countDevicesWithResponseAsync( - String resourceGroupName, String catalogName, String productName, Context context) { + private Mono> countDevicesWithResponseAsync(String resourceGroupName, + String catalogName, String productName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1446,22 +1224,14 @@ private Mono> countDevicesWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .countDevices( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - accept, - context); + return service.countDevices(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, accept, context); } /** * Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product * name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1471,8 +1241,8 @@ private Mono> countDevicesWithResponseAsync( * @return response to the action call for count devices in a catalog on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono countDevicesAsync( - String resourceGroupName, String catalogName, String productName) { + private Mono countDevicesAsync(String resourceGroupName, String catalogName, + String productName) { return countDevicesWithResponseAsync(resourceGroupName, catalogName, productName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -1480,7 +1250,7 @@ private Mono countDevicesAsync( /** * Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product * name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1491,15 +1261,15 @@ private Mono countDevicesAsync( * @return response to the action call for count devices in a catalog along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response countDevicesWithResponse( - String resourceGroupName, String catalogName, String productName, Context context) { + public Response countDevicesWithResponse(String resourceGroupName, String catalogName, + String productName, Context context) { return countDevicesWithResponseAsync(resourceGroupName, catalogName, productName, context).block(); } /** * Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product * name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1509,14 +1279,14 @@ public Response countDevicesWithResponse( * @return response to the action call for count devices in a catalog. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CountDeviceResponseInner countDevices(String resourceGroupName, String catalogName, String productName) { + public CountDevicesResponseInner countDevices(String resourceGroupName, String catalogName, String productName) { return countDevicesWithResponse(resourceGroupName, catalogName, productName, Context.NONE).getValue(); } /** * Generates default device groups for the product. '.default' and '.unassigned' are system defined values and * cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1524,22 +1294,18 @@ public CountDeviceResponseInner countDevices(String resourceGroupName, String ca * @throws ManagementException thrown 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 a DeviceGroup list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> generateDefaultDeviceGroupsSinglePageAsync( - String resourceGroupName, String catalogName, String productName) { + private Mono> generateDefaultDeviceGroupsSinglePageAsync(String resourceGroupName, + String catalogName, String productName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1554,33 +1320,17 @@ private Mono> generateDefaultDeviceGroupsSingleP final String accept = "application/json"; return FluxUtil .withContext( - context -> - service - .generateDefaultDeviceGroups( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + context -> service.generateDefaultDeviceGroups(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Generates default device groups for the product. '.default' and '.unassigned' are system defined values and * cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1589,22 +1339,18 @@ private Mono> generateDefaultDeviceGroupsSingleP * @throws ManagementException thrown 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 a DeviceGroup list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> generateDefaultDeviceGroupsSinglePageAsync( - String resourceGroupName, String catalogName, String productName, Context context) { + private Mono> generateDefaultDeviceGroupsSinglePageAsync(String resourceGroupName, + String catalogName, String productName, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required 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 Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -1619,30 +1365,16 @@ private Mono> generateDefaultDeviceGroupsSingleP final String accept = "application/json"; context = this.client.mergeContext(context); return service - .generateDefaultDeviceGroups( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - catalogName, - productName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .generateDefaultDeviceGroups(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, catalogName, productName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Generates default device groups for the product. '.default' and '.unassigned' are system defined values and * cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1652,8 +1384,8 @@ private Mono> generateDefaultDeviceGroupsSingleP * @return the response of a DeviceGroup list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux generateDefaultDeviceGroupsAsync( - String resourceGroupName, String catalogName, String productName) { + private PagedFlux generateDefaultDeviceGroupsAsync(String resourceGroupName, String catalogName, + String productName) { return new PagedFlux<>( () -> generateDefaultDeviceGroupsSinglePageAsync(resourceGroupName, catalogName, productName), nextLink -> generateDefaultDeviceGroupsNextSinglePageAsync(nextLink)); @@ -1662,7 +1394,7 @@ private PagedFlux generateDefaultDeviceGroupsAsync( /** * Generates default device groups for the product. '.default' and '.unassigned' are system defined values and * cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1673,8 +1405,8 @@ private PagedFlux generateDefaultDeviceGroupsAsync( * @return the response of a DeviceGroup list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux generateDefaultDeviceGroupsAsync( - String resourceGroupName, String catalogName, String productName, Context context) { + private PagedFlux generateDefaultDeviceGroupsAsync(String resourceGroupName, String catalogName, + String productName, Context context) { return new PagedFlux<>( () -> generateDefaultDeviceGroupsSinglePageAsync(resourceGroupName, catalogName, productName, context), nextLink -> generateDefaultDeviceGroupsNextSinglePageAsync(nextLink, context)); @@ -1683,7 +1415,7 @@ private PagedFlux generateDefaultDeviceGroupsAsync( /** * Generates default device groups for the product. '.default' and '.unassigned' are system defined values and * cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1693,15 +1425,15 @@ private PagedFlux generateDefaultDeviceGroupsAsync( * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable generateDefaultDeviceGroups( - String resourceGroupName, String catalogName, String productName) { + public PagedIterable generateDefaultDeviceGroups(String resourceGroupName, String catalogName, + String productName) { return new PagedIterable<>(generateDefaultDeviceGroupsAsync(resourceGroupName, catalogName, productName)); } /** * Generates default device groups for the product. '.default' and '.unassigned' are system defined values and * cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -1712,22 +1444,23 @@ public PagedIterable generateDefaultDeviceGroups( * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable generateDefaultDeviceGroups( - String resourceGroupName, String catalogName, String productName, Context context) { + public PagedIterable generateDefaultDeviceGroups(String resourceGroupName, String catalogName, + String productName, Context context) { return new PagedIterable<>( generateDefaultDeviceGroupsAsync(resourceGroupName, catalogName, productName, context)); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 a Product list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByCatalogNextSinglePageAsync(String nextLink) { @@ -1735,37 +1468,29 @@ private Mono> listByCatalogNextSinglePageAsync(Strin return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByCatalogNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 a Product list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByCatalogNextSinglePageAsync(String nextLink, Context context) { @@ -1773,36 +1498,27 @@ private Mono> listByCatalogNextSinglePageAsync(Strin return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByCatalogNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByCatalogNext(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 URL to get the next list of items - *

The nextLink parameter. + * + * 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 a DeviceGroup list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> generateDefaultDeviceGroupsNextSinglePageAsync(String nextLink) { @@ -1810,64 +1526,44 @@ private Mono> generateDefaultDeviceGroupsNextSin return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.generateDefaultDeviceGroupsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext( + context -> service.generateDefaultDeviceGroupsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * 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 a DeviceGroup list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> generateDefaultDeviceGroupsNextSinglePageAsync( - String nextLink, Context context) { + private Mono> generateDefaultDeviceGroupsNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .generateDefaultDeviceGroupsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.generateDefaultDeviceGroupsNext(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/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductsImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductsImpl.java index c58e2369b00ca..4e76a66cc0174 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductsImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProductsImpl.java @@ -10,10 +10,10 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.sphere.fluent.ProductsClient; -import com.azure.resourcemanager.sphere.fluent.models.CountDeviceResponseInner; +import com.azure.resourcemanager.sphere.fluent.models.CountDevicesResponseInner; import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner; import com.azure.resourcemanager.sphere.fluent.models.ProductInner; -import com.azure.resourcemanager.sphere.models.CountDeviceResponse; +import com.azure.resourcemanager.sphere.models.CountDevicesResponse; import com.azure.resourcemanager.sphere.models.DeviceGroup; import com.azure.resourcemanager.sphere.models.Product; import com.azure.resourcemanager.sphere.models.Products; @@ -25,31 +25,28 @@ public final class ProductsImpl implements Products { private final com.azure.resourcemanager.sphere.AzureSphereManager serviceManager; - public ProductsImpl( - ProductsClient innerClient, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { + public ProductsImpl(ProductsClient innerClient, + com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable listByCatalog(String resourceGroupName, String catalogName) { PagedIterable inner = this.serviceClient().listByCatalog(resourceGroupName, catalogName); - return Utils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); } public PagedIterable listByCatalog(String resourceGroupName, String catalogName, Context context) { PagedIterable inner = this.serviceClient().listByCatalog(resourceGroupName, catalogName, context); - return Utils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager())); } - public Response getWithResponse( - String resourceGroupName, String catalogName, String productName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, catalogName, productName, context); + public Response getWithResponse(String resourceGroupName, String catalogName, String productName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, catalogName, productName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new ProductImpl(inner.getValue(), this.manager())); } else { return null; @@ -73,144 +70,114 @@ public void delete(String resourceGroupName, String catalogName, String productN this.serviceClient().delete(resourceGroupName, catalogName, productName, context); } - public Response countDevicesWithResponse( - String resourceGroupName, String catalogName, String productName, Context context) { - Response inner = - this.serviceClient().countDevicesWithResponse(resourceGroupName, catalogName, productName, context); + public Response countDevicesWithResponse(String resourceGroupName, String catalogName, + String productName, Context context) { + Response inner + = this.serviceClient().countDevicesWithResponse(resourceGroupName, catalogName, productName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new CountDeviceResponseImpl(inner.getValue(), this.manager())); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CountDevicesResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public CountDeviceResponse countDevices(String resourceGroupName, String catalogName, String productName) { - CountDeviceResponseInner inner = this.serviceClient().countDevices(resourceGroupName, catalogName, productName); + public CountDevicesResponse countDevices(String resourceGroupName, String catalogName, String productName) { + CountDevicesResponseInner inner + = this.serviceClient().countDevices(resourceGroupName, catalogName, productName); if (inner != null) { - return new CountDeviceResponseImpl(inner, this.manager()); + return new CountDevicesResponseImpl(inner, this.manager()); } else { return null; } } - public PagedIterable generateDefaultDeviceGroups( - String resourceGroupName, String catalogName, String productName) { - PagedIterable inner = - this.serviceClient().generateDefaultDeviceGroups(resourceGroupName, catalogName, productName); - return Utils.mapPage(inner, inner1 -> new DeviceGroupImpl(inner1, this.manager())); + public PagedIterable generateDefaultDeviceGroups(String resourceGroupName, String catalogName, + String productName) { + PagedIterable inner + = this.serviceClient().generateDefaultDeviceGroups(resourceGroupName, catalogName, productName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceGroupImpl(inner1, this.manager())); } - public PagedIterable generateDefaultDeviceGroups( - String resourceGroupName, String catalogName, String productName, Context context) { - PagedIterable inner = - this.serviceClient().generateDefaultDeviceGroups(resourceGroupName, catalogName, productName, context); - return Utils.mapPage(inner, inner1 -> new DeviceGroupImpl(inner1, this.manager())); + public PagedIterable generateDefaultDeviceGroups(String resourceGroupName, String catalogName, + String productName, Context context) { + PagedIterable inner + = this.serviceClient().generateDefaultDeviceGroups(resourceGroupName, catalogName, productName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new DeviceGroupImpl(inner1, this.manager())); } public Product getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String productName = Utils.getValueFromIdByName(id, "products"); + String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); if (productName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); } return this.getWithResponse(resourceGroupName, catalogName, productName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String productName = Utils.getValueFromIdByName(id, "products"); + String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); if (productName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); } return this.getWithResponse(resourceGroupName, catalogName, productName, context); } public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String productName = Utils.getValueFromIdByName(id, "products"); + String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); if (productName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); } this.delete(resourceGroupName, catalogName, productName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String catalogName = Utils.getValueFromIdByName(id, "catalogs"); + String catalogName = ResourceManagerUtils.getValueFromIdByName(id, "catalogs"); if (catalogName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'catalogs'.", id))); } - String productName = Utils.getValueFromIdByName(id, "products"); + String productName = ResourceManagerUtils.getValueFromIdByName(id, "products"); if (productName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'products'.", id))); } this.delete(resourceGroupName, catalogName, productName, context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProofOfPossessionNonceResponseImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProofOfPossessionNonceResponseImpl.java index ac1feb2ee3e36..431290bc7a552 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProofOfPossessionNonceResponseImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ProofOfPossessionNonceResponseImpl.java @@ -15,8 +15,7 @@ public final class ProofOfPossessionNonceResponseImpl implements ProofOfPossessi private final com.azure.resourcemanager.sphere.AzureSphereManager serviceManager; - ProofOfPossessionNonceResponseImpl( - ProofOfPossessionNonceResponseInner innerObject, + ProofOfPossessionNonceResponseImpl(ProofOfPossessionNonceResponseInner innerObject, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/Utils.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ResourceManagerUtils.java similarity index 79% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/Utils.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ResourceManagerUtils.java index 505f4413ce8df..a0c9f67958a66 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/Utils.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/ResourceManagerUtils.java @@ -19,7 +19,10 @@ import java.util.stream.Stream; import reactor.core.publisher.Flux; -final class Utils { +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + static String getValueFromIdByName(String id, String name) { if (id == null) { return null; @@ -38,6 +41,7 @@ static String getValueFromIdByName(String id, String name) { } } return null; + } static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { @@ -60,7 +64,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri segments.add(idSegment); idItrReverted.forEachRemaining(segments::add); Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { + if (!segments.isEmpty() && segments.get(0).isEmpty()) { segments.remove(0); } return String.join("/", segments); @@ -71,10 +75,11 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } } return null; + } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -84,26 +89,17 @@ private static final class PagedIterableImpl extends PagedIterable { private final Function, PagedResponse> pageMapper; private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(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); + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); } @Override @@ -133,30 +129,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -198,7 +191,7 @@ private IterableImpl(Iterable iterable, Function mapper) { @Override public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); + return new IteratorImpl<>(iterable.iterator(), mapper); } } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/SignedCapabilityImageResponseImpl.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/SignedCapabilityImageResponseImpl.java index 95d73dc3ec3eb..d5767277af923 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/SignedCapabilityImageResponseImpl.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/SignedCapabilityImageResponseImpl.java @@ -12,8 +12,7 @@ public final class SignedCapabilityImageResponseImpl implements SignedCapability private final com.azure.resourcemanager.sphere.AzureSphereManager serviceManager; - SignedCapabilityImageResponseImpl( - SignedCapabilityImageResponseInner innerObject, + SignedCapabilityImageResponseImpl(SignedCapabilityImageResponseInner innerObject, com.azure.resourcemanager.sphere.AzureSphereManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/package-info.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/package-info.java index 0f24134af586d..878a1be7d183a 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/package-info.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/implementation/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the implementations for AzureSphereManagementClient. Azure Sphere resource management API. */ +/** + * Package containing the implementations for AzureSphereMgmtClient. + * Azure Sphere resource management API. + */ package com.azure.resourcemanager.sphere.implementation; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ActionType.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ActionType.java index 16187bc8760ca..8a331ea51dcfc 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ActionType.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ActionType.java @@ -8,14 +8,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +/** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ public final class ActionType extends ExpandableStringEnum { - /** Static value Internal for ActionType. */ + /** + * Static value Internal for ActionType. + */ public static final ActionType INTERNAL = fromString("Internal"); /** * Creates a new instance of ActionType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,7 +28,7 @@ public ActionType() { /** * Creates or finds a ActionType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ActionType. */ @@ -35,7 +39,7 @@ public static ActionType fromString(String name) { /** * Gets known ActionType values. - * + * * @return known ActionType values. */ public static Collection values() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/AllowCrashDumpCollection.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/AllowCrashDumpCollection.java index 421f6c355637a..3fb7732e3328e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/AllowCrashDumpCollection.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/AllowCrashDumpCollection.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Allow crash dumps values. */ +/** + * Allow crash dumps values. + */ public final class AllowCrashDumpCollection extends ExpandableStringEnum { - /** Static value Enabled for AllowCrashDumpCollection. */ + /** + * Static value Enabled for AllowCrashDumpCollection. + */ public static final AllowCrashDumpCollection ENABLED = fromString("Enabled"); - /** Static value Disabled for AllowCrashDumpCollection. */ + /** + * Static value Disabled for AllowCrashDumpCollection. + */ public static final AllowCrashDumpCollection DISABLED = fromString("Disabled"); /** * Creates a new instance of AllowCrashDumpCollection value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public AllowCrashDumpCollection() { /** * Creates or finds a AllowCrashDumpCollection from its string representation. - * + * * @param name a name to look for. * @return the corresponding AllowCrashDumpCollection. */ @@ -38,7 +44,7 @@ public static AllowCrashDumpCollection fromString(String name) { /** * Gets known AllowCrashDumpCollection values. - * + * * @return known AllowCrashDumpCollection values. */ public static Collection values() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CapabilityType.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CapabilityType.java index 20606302764a2..a3f2ec5709f2e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CapabilityType.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CapabilityType.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Capability image type. */ +/** + * Capability image type. + */ public final class CapabilityType extends ExpandableStringEnum { - /** Static value ApplicationDevelopment for CapabilityType. */ + /** + * Static value ApplicationDevelopment for CapabilityType. + */ public static final CapabilityType APPLICATION_DEVELOPMENT = fromString("ApplicationDevelopment"); - /** Static value FieldServicing for CapabilityType. */ + /** + * Static value FieldServicing for CapabilityType. + */ public static final CapabilityType FIELD_SERVICING = fromString("FieldServicing"); /** * Creates a new instance of CapabilityType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public CapabilityType() { /** * Creates or finds a CapabilityType from its string representation. - * + * * @param name a name to look for. * @return the corresponding CapabilityType. */ @@ -38,7 +44,7 @@ public static CapabilityType fromString(String name) { /** * Gets known CapabilityType values. - * + * * @return known CapabilityType values. */ public static Collection values() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Catalog.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Catalog.java index f93fe02c2a042..4cfb60a7b47e8 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Catalog.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Catalog.java @@ -10,106 +10,114 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.sphere.fluent.models.CatalogInner; +import com.azure.resourcemanager.sphere.fluent.models.ImageInner; import java.util.Map; -/** An immutable client-side representation of Catalog. */ +/** + * An immutable client-side representation of Catalog. + */ public interface Catalog { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - SystemData systemData(); + CatalogProperties properties(); /** - * Gets the provisioningState property: The status of the last operation. - * - * @return the provisioningState value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - ProvisioningState provisioningState(); + SystemData systemData(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.sphere.fluent.models.CatalogInner object. - * + * * @return the inner object. */ CatalogInner innerModel(); - /** The entirety of the Catalog definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { + /** + * The entirety of the Catalog definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } - /** The Catalog definition stages. */ + /** + * The Catalog definition stages. + */ interface DefinitionStages { - /** The first stage of the Catalog definition. */ + /** + * The first stage of the Catalog definition. + */ interface Blank extends WithLocation { } - /** The stage of the Catalog definition allowing to specify location. */ + /** + * The stage of the Catalog definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -117,18 +125,20 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the Catalog definition allowing to specify parent resource. */ + /** + * The stage of the Catalog definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ @@ -139,67 +149,88 @@ interface WithResourceGroup { * The stage of the Catalog 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 DefinitionStages.WithTags { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { /** * Executes the create request. - * + * * @return the created resource. */ Catalog create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Catalog create(Context context); } - /** The stage of the Catalog definition allowing to specify tags. */ + /** + * The stage of the Catalog definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } + + /** + * The stage of the Catalog definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(CatalogProperties properties); + } } /** * Begins update for the Catalog resource. - * + * * @return the stage of resource update. */ Catalog.Update update(); - /** The template for Catalog update. */ + /** + * The template for Catalog update. + */ interface Update extends UpdateStages.WithTags { /** * Executes the update request. - * + * * @return the updated resource. */ Catalog apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Catalog apply(Context context); } - /** The Catalog update stages. */ + /** + * The Catalog update stages. + */ interface UpdateStages { - /** The stage of the Catalog update allowing to specify tags. */ + /** + * The stage of the Catalog update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ @@ -209,14 +240,14 @@ interface WithTags { /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Catalog refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -224,27 +255,27 @@ interface WithTags { /** * Counts devices in catalog. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response to the action call for count devices in a catalog along with {@link Response}. */ - Response countDevicesWithResponse(Context context); + Response countDevicesWithResponse(Context context); /** * Counts devices in catalog. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response to the action call for count devices in a catalog. */ - CountDeviceResponse countDevices(); + CountDevicesResponse countDevices(); /** * Lists deployments for catalog. - * + * * @throws com.azure.core.management.exception.ManagementException thrown 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 a Deployment list operation as paginated response with {@link PagedIterable}. @@ -253,7 +284,7 @@ interface WithTags { /** * Lists deployments for catalog. - * + * * @param filter Filter the result list using the given expression. * @param top The number of result items to return. * @param skip The number of result items to skip. @@ -264,12 +295,12 @@ interface WithTags { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a Deployment list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listDeployments( - String filter, Integer top, Integer skip, Integer maxpagesize, Context context); + PagedIterable listDeployments(String filter, Integer top, Integer skip, Integer maxpagesize, + Context context); /** * List the device groups for the catalog. - * + * * @param listDeviceGroupsRequest List device groups for catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -280,7 +311,7 @@ PagedIterable listDeployments( /** * List the device groups for the catalog. - * + * * @param listDeviceGroupsRequest List device groups for catalog. * @param filter Filter the result list using the given expression. * @param top The number of result items to return. @@ -292,17 +323,12 @@ PagedIterable listDeployments( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listDeviceGroups( - ListDeviceGroupsRequest listDeviceGroupsRequest, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context); + PagedIterable listDeviceGroups(ListDeviceGroupsRequest listDeviceGroupsRequest, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context); /** * Lists device insights for catalog. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return paged collection of DeviceInsight items as paginated response with {@link PagedIterable}. @@ -311,7 +337,7 @@ PagedIterable listDeviceGroups( /** * Lists device insights for catalog. - * + * * @param filter Filter the result list using the given expression. * @param top The number of result items to return. * @param skip The number of result items to skip. @@ -322,12 +348,12 @@ PagedIterable listDeviceGroups( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return paged collection of DeviceInsight items as paginated response with {@link PagedIterable}. */ - PagedIterable listDeviceInsights( - String filter, Integer top, Integer skip, Integer maxpagesize, Context context); + PagedIterable listDeviceInsights(String filter, Integer top, Integer skip, Integer maxpagesize, + Context context); /** * Lists devices for catalog. - * + * * @throws com.azure.core.management.exception.ManagementException thrown 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 a Device list operation as paginated response with {@link PagedIterable}. @@ -336,7 +362,7 @@ PagedIterable listDeviceInsights( /** * Lists devices for catalog. - * + * * @param filter Filter the result list using the given expression. * @param top The number of result items to return. * @param skip The number of result items to skip. @@ -348,4 +374,25 @@ PagedIterable listDeviceInsights( * @return the response of a Device list operation as paginated response with {@link PagedIterable}. */ PagedIterable listDevices(String filter, Integer top, Integer skip, Integer maxpagesize, Context context); + + /** + * Creates an image. Use this action when the image ID is unknown. + * + * @param uploadImageRequest Image upload 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. + */ + void uploadImage(ImageInner uploadImageRequest); + + /** + * Creates an image. Use this action when the image ID is unknown. + * + * @param uploadImageRequest Image upload 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. + */ + void uploadImage(ImageInner uploadImageRequest, Context context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogListResult.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogListResult.java index 9c82d8fefe24f..2af7d44df5d3b 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogListResult.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogListResult.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a Catalog list operation. */ +/** + * The response of a Catalog list operation. + */ @Fluent public final class CatalogListResult { /* @@ -22,16 +24,18 @@ public final class CatalogListResult { /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of CatalogListResult class. */ + /** + * Creates an instance of CatalogListResult class. + */ public CatalogListResult() { } /** * Get the value property: The Catalog items on this page. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The Catalog items on this page. - * + * * @param value the value value to set. * @return the CatalogListResult object itself. */ @@ -51,34 +55,22 @@ public CatalogListResult withValue(List value) { /** * Get the nextLink property: The link to the next page of items. - * + * * @return the nextLink value. */ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the CatalogListResult object itself. - */ - public CatalogListResult 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 CatalogListResult")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model CatalogListResult")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CatalogProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogProperties.java similarity index 62% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CatalogProperties.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogProperties.java index e5e5c035f83a0..e176c812f6f3d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CatalogProperties.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogProperties.java @@ -2,28 +2,46 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.sphere.fluent.models; +package com.azure.resourcemanager.sphere.models; import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.sphere.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; -/** Catalog properties. */ +/** + * Catalog properties. + */ @Immutable public final class CatalogProperties { + /* + * The Azure Sphere tenant ID associated with the catalog. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + /* * The status of the last operation. */ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; - /** Creates an instance of CatalogProperties class. */ + /** + * Creates an instance of CatalogProperties class. + */ public CatalogProperties() { } + /** + * Get the tenantId property: The Azure Sphere tenant ID associated with the catalog. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + /** * Get the provisioningState property: The status of the last operation. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -32,7 +50,7 @@ public ProvisioningState provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogUpdate.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogUpdate.java index a8798215ccb2c..63df52959467a 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogUpdate.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CatalogUpdate.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** The type used for update operations of the Catalog. */ +/** + * The type used for update operations of the Catalog. + */ @Fluent public final class CatalogUpdate { /* @@ -19,13 +21,15 @@ public final class CatalogUpdate { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; - /** Creates an instance of CatalogUpdate class. */ + /** + * Creates an instance of CatalogUpdate class. + */ public CatalogUpdate() { } /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -34,7 +38,7 @@ public Map tags() { /** * Set the tags property: Resource tags. - * + * * @param tags the tags value to set. * @return the CatalogUpdate object itself. */ @@ -45,7 +49,7 @@ public CatalogUpdate withTags(Map tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Catalogs.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Catalogs.java index b7919b56ccf95..d399d00ab62d4 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Catalogs.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Catalogs.java @@ -7,12 +7,15 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; +import com.azure.resourcemanager.sphere.fluent.models.ImageInner; -/** Resource collection API of Catalogs. */ +/** + * Resource collection API of Catalogs. + */ public interface Catalogs { /** * List Catalog resources by subscription ID. - * + * * @throws com.azure.core.management.exception.ManagementException thrown 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 a Catalog list operation as paginated response with {@link PagedIterable}. @@ -21,7 +24,7 @@ public interface Catalogs { /** * List Catalog resources by subscription 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. @@ -32,7 +35,7 @@ public interface Catalogs { /** * List Catalog resources by 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. @@ -43,7 +46,7 @@ public interface Catalogs { /** * List Catalog resources by 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. @@ -55,7 +58,7 @@ public interface Catalogs { /** * Get a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -68,7 +71,7 @@ public interface Catalogs { /** * Get a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -80,7 +83,7 @@ public interface Catalogs { /** * Delete a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -91,7 +94,7 @@ public interface Catalogs { /** * Delete a Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -103,7 +106,7 @@ public interface Catalogs { /** * Counts devices in catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -112,12 +115,12 @@ public interface Catalogs { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response to the action call for count devices in a catalog along with {@link Response}. */ - Response countDevicesWithResponse( - String resourceGroupName, String catalogName, Context context); + Response countDevicesWithResponse(String resourceGroupName, String catalogName, + Context context); /** * Counts devices in catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -125,11 +128,11 @@ Response countDevicesWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response to the action call for count devices in a catalog. */ - CountDeviceResponse countDevices(String resourceGroupName, String catalogName); + CountDevicesResponse countDevices(String resourceGroupName, String catalogName); /** * Lists deployments for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -141,7 +144,7 @@ Response countDevicesWithResponse( /** * Lists deployments for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -154,18 +157,12 @@ Response countDevicesWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a Deployment list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listDeployments( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context); + PagedIterable listDeployments(String resourceGroupName, String catalogName, String filter, Integer top, + Integer skip, Integer maxpagesize, Context context); /** * List the device groups for the catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param listDeviceGroupsRequest List device groups for catalog. @@ -174,12 +171,12 @@ PagedIterable listDeployments( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listDeviceGroups( - String resourceGroupName, String catalogName, ListDeviceGroupsRequest listDeviceGroupsRequest); + PagedIterable listDeviceGroups(String resourceGroupName, String catalogName, + ListDeviceGroupsRequest listDeviceGroupsRequest); /** * List the device groups for the catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param listDeviceGroupsRequest List device groups for catalog. @@ -193,19 +190,13 @@ PagedIterable listDeviceGroups( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listDeviceGroups( - String resourceGroupName, - String catalogName, - ListDeviceGroupsRequest listDeviceGroupsRequest, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, + PagedIterable listDeviceGroups(String resourceGroupName, String catalogName, + ListDeviceGroupsRequest listDeviceGroupsRequest, String filter, Integer top, Integer skip, Integer maxpagesize, Context context); /** * Lists device insights for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -217,7 +208,7 @@ PagedIterable listDeviceGroups( /** * Lists device insights for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -230,18 +221,12 @@ PagedIterable listDeviceGroups( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return paged collection of DeviceInsight items as paginated response with {@link PagedIterable}. */ - PagedIterable listDeviceInsights( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context); + PagedIterable listDeviceInsights(String resourceGroupName, String catalogName, String filter, + Integer top, Integer skip, Integer maxpagesize, Context context); /** * Lists devices for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -253,7 +238,7 @@ PagedIterable listDeviceInsights( /** * Lists devices for catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -266,18 +251,37 @@ PagedIterable listDeviceInsights( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a Device list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listDevices( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context); + PagedIterable listDevices(String resourceGroupName, String catalogName, String filter, Integer top, + Integer skip, Integer maxpagesize, Context context); + + /** + * Creates an image. Use this action when the image ID is unknown. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param uploadImageRequest Image upload 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. + */ + void uploadImage(String resourceGroupName, String catalogName, ImageInner uploadImageRequest); + + /** + * Creates an image. Use this action when the image ID is unknown. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param catalogName Name of catalog. + * @param uploadImageRequest Image upload 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. + */ + void uploadImage(String resourceGroupName, String catalogName, ImageInner uploadImageRequest, Context context); /** * Get a Catalog. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -288,7 +292,7 @@ PagedIterable listDevices( /** * Get a Catalog. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -300,7 +304,7 @@ PagedIterable listDevices( /** * Delete a Catalog. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -310,7 +314,7 @@ PagedIterable listDevices( /** * Delete a Catalog. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -321,7 +325,7 @@ PagedIterable listDevices( /** * Begins definition for a new Catalog resource. - * + * * @param name resource name. * @return the first stage of the new Catalog definition. */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Certificate.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Certificate.java index 458d70f643c8b..1aee6fd4d576d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Certificate.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Certificate.java @@ -6,90 +6,49 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.sphere.fluent.models.CertificateInner; -import java.time.OffsetDateTime; -/** An immutable client-side representation of Certificate. */ +/** + * An immutable client-side representation of Certificate. + */ public interface Certificate { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the certificate property: The certificate as a UTF-8 encoded base 64 string. - * - * @return the certificate value. - */ - String certificate(); - - /** - * Gets the status property: The certificate status. - * - * @return the status value. - */ - CertificateStatus status(); - - /** - * Gets the subject property: The certificate subject. - * - * @return the subject value. + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - String subject(); + CertificateProperties properties(); /** - * Gets the thumbprint property: The certificate thumbprint. - * - * @return the thumbprint value. - */ - String thumbprint(); - - /** - * Gets the expiryUtc property: The certificate expiry date. - * - * @return the expiryUtc value. - */ - OffsetDateTime expiryUtc(); - - /** - * Gets the notBeforeUtc property: The certificate not before date. - * - * @return the notBeforeUtc value. - */ - OffsetDateTime notBeforeUtc(); - - /** - * Gets the provisioningState property: The status of the last operation. - * - * @return the provisioningState value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - ProvisioningState provisioningState(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.sphere.fluent.models.CertificateInner object. - * + * * @return the inner object. */ CertificateInner innerModel(); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateChainResponse.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateChainResponse.java index 9ecd4c11ccc0f..940f393fa3a8d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateChainResponse.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateChainResponse.java @@ -6,18 +6,20 @@ import com.azure.resourcemanager.sphere.fluent.models.CertificateChainResponseInner; -/** An immutable client-side representation of CertificateChainResponse. */ +/** + * An immutable client-side representation of CertificateChainResponse. + */ public interface CertificateChainResponse { /** * Gets the certificateChain property: The certificate chain. - * + * * @return the certificateChain value. */ String certificateChain(); /** * Gets the inner com.azure.resourcemanager.sphere.fluent.models.CertificateChainResponseInner object. - * + * * @return the inner object. */ CertificateChainResponseInner innerModel(); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateListResult.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateListResult.java index 6325d017199a2..b303342e195e9 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateListResult.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateListResult.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a Certificate list operation. */ +/** + * The response of a Certificate list operation. + */ @Fluent public final class CertificateListResult { /* @@ -22,16 +24,18 @@ public final class CertificateListResult { /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of CertificateListResult class. */ + /** + * Creates an instance of CertificateListResult class. + */ public CertificateListResult() { } /** * Get the value property: The Certificate items on this page. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The Certificate items on this page. - * + * * @param value the value value to set. * @return the CertificateListResult object itself. */ @@ -51,34 +55,22 @@ public CertificateListResult withValue(List value) { /** * Get the nextLink property: The link to the next page of items. - * + * * @return the nextLink value. */ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the CertificateListResult object itself. - */ - public CertificateListResult 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 CertificateListResult")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model CertificateListResult")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CertificateProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateProperties.java similarity index 90% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CertificateProperties.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateProperties.java index 94db576f28bde..ff0a7b9f59c4e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/CertificateProperties.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateProperties.java @@ -2,15 +2,15 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.sphere.fluent.models; +package com.azure.resourcemanager.sphere.models; import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.sphere.models.CertificateStatus; -import com.azure.resourcemanager.sphere.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** The properties of certificate. */ +/** + * The properties of certificate. + */ @Immutable public class CertificateProperties { /* @@ -55,13 +55,15 @@ public class CertificateProperties { @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; - /** Creates an instance of CertificateProperties class. */ + /** + * Creates an instance of CertificateProperties class. + */ public CertificateProperties() { } /** * Get the certificate property: The certificate as a UTF-8 encoded base 64 string. - * + * * @return the certificate value. */ public String certificate() { @@ -70,7 +72,7 @@ public String certificate() { /** * Get the status property: The certificate status. - * + * * @return the status value. */ public CertificateStatus status() { @@ -79,7 +81,7 @@ public CertificateStatus status() { /** * Get the subject property: The certificate subject. - * + * * @return the subject value. */ public String subject() { @@ -88,7 +90,7 @@ public String subject() { /** * Get the thumbprint property: The certificate thumbprint. - * + * * @return the thumbprint value. */ public String thumbprint() { @@ -97,7 +99,7 @@ public String thumbprint() { /** * Get the expiryUtc property: The certificate expiry date. - * + * * @return the expiryUtc value. */ public OffsetDateTime expiryUtc() { @@ -106,7 +108,7 @@ public OffsetDateTime expiryUtc() { /** * Get the notBeforeUtc property: The certificate not before date. - * + * * @return the notBeforeUtc value. */ public OffsetDateTime notBeforeUtc() { @@ -115,7 +117,7 @@ public OffsetDateTime notBeforeUtc() { /** * Get the provisioningState property: The status of the last operation. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -124,7 +126,7 @@ public ProvisioningState provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateStatus.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateStatus.java index e38e138072baf..0ef99819e1d63 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateStatus.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CertificateStatus.java @@ -8,23 +8,33 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Certificate status values. */ +/** + * Certificate status values. + */ public final class CertificateStatus extends ExpandableStringEnum { - /** Static value Active for CertificateStatus. */ + /** + * Static value Active for CertificateStatus. + */ public static final CertificateStatus ACTIVE = fromString("Active"); - /** Static value Inactive for CertificateStatus. */ + /** + * Static value Inactive for CertificateStatus. + */ public static final CertificateStatus INACTIVE = fromString("Inactive"); - /** Static value Expired for CertificateStatus. */ + /** + * Static value Expired for CertificateStatus. + */ public static final CertificateStatus EXPIRED = fromString("Expired"); - /** Static value Revoked for CertificateStatus. */ + /** + * Static value Revoked for CertificateStatus. + */ public static final CertificateStatus REVOKED = fromString("Revoked"); /** * Creates a new instance of CertificateStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,7 +43,7 @@ public CertificateStatus() { /** * Creates or finds a CertificateStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding CertificateStatus. */ @@ -44,7 +54,7 @@ public static CertificateStatus fromString(String name) { /** * Gets known CertificateStatus values. - * + * * @return known CertificateStatus values. */ public static Collection values() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Certificates.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Certificates.java index 0ed52f203f244..bf130ef1ce0fe 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Certificates.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Certificates.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Certificates. */ +/** + * Resource collection API of Certificates. + */ public interface Certificates { /** * List Certificate resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +26,7 @@ public interface Certificates { /** * List Certificate resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -37,18 +39,12 @@ public interface Certificates { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a Certificate list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByCatalog( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context); + PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, Integer top, + Integer skip, Integer maxpagesize, Context context); /** * Get a Certificate. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -58,12 +54,12 @@ PagedIterable listByCatalog( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Certificate along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String catalogName, String serialNumber, Context context); + Response getWithResponse(String resourceGroupName, String catalogName, String serialNumber, + Context context); /** * Get a Certificate. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -76,7 +72,7 @@ Response getWithResponse( /** * Retrieves cert chain. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -86,12 +82,12 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the certificate chain response along with {@link Response}. */ - Response retrieveCertChainWithResponse( - String resourceGroupName, String catalogName, String serialNumber, Context context); + Response retrieveCertChainWithResponse(String resourceGroupName, String catalogName, + String serialNumber, Context context); /** * Retrieves cert chain. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -104,7 +100,7 @@ Response retrieveCertChainWithResponse( /** * Gets the proof of possession nonce. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -115,16 +111,13 @@ Response retrieveCertChainWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the proof of possession nonce along with {@link Response}. */ - Response retrieveProofOfPossessionNonceWithResponse( - String resourceGroupName, - String catalogName, - String serialNumber, - ProofOfPossessionNonceRequest proofOfPossessionNonceRequest, + Response retrieveProofOfPossessionNonceWithResponse(String resourceGroupName, + String catalogName, String serialNumber, ProofOfPossessionNonceRequest proofOfPossessionNonceRequest, Context context); /** * Gets the proof of possession nonce. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param serialNumber Serial number of the certificate. Use '.default' to get current active certificate. @@ -134,9 +127,6 @@ Response retrieveProofOfPossessionNonceWithRespo * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the proof of possession nonce. */ - ProofOfPossessionNonceResponse retrieveProofOfPossessionNonce( - String resourceGroupName, - String catalogName, - String serialNumber, - ProofOfPossessionNonceRequest proofOfPossessionNonceRequest); + ProofOfPossessionNonceResponse retrieveProofOfPossessionNonce(String resourceGroupName, String catalogName, + String serialNumber, ProofOfPossessionNonceRequest proofOfPossessionNonceRequest); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ClaimDevicesRequest.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ClaimDevicesRequest.java index ae3e8c806059d..12cd6f0eb35df 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ClaimDevicesRequest.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ClaimDevicesRequest.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Request to the action call to bulk claim devices. */ +/** + * Request to the action call to bulk claim devices. + */ @Fluent public final class ClaimDevicesRequest { /* @@ -18,13 +20,15 @@ public final class ClaimDevicesRequest { @JsonProperty(value = "deviceIdentifiers", required = true) private List deviceIdentifiers; - /** Creates an instance of ClaimDevicesRequest class. */ + /** + * Creates an instance of ClaimDevicesRequest class. + */ public ClaimDevicesRequest() { } /** * Get the deviceIdentifiers property: Device identifiers of the devices to be claimed. - * + * * @return the deviceIdentifiers value. */ public List deviceIdentifiers() { @@ -33,7 +37,7 @@ public List deviceIdentifiers() { /** * Set the deviceIdentifiers property: Device identifiers of the devices to be claimed. - * + * * @param deviceIdentifiers the deviceIdentifiers value to set. * @return the ClaimDevicesRequest object itself. */ @@ -44,15 +48,13 @@ public ClaimDevicesRequest withDeviceIdentifiers(List deviceIdentifiers) /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (deviceIdentifiers() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property deviceIdentifiers in model ClaimDevicesRequest")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property deviceIdentifiers in model ClaimDevicesRequest")); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountDeviceResponse.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountDeviceResponse.java index 7cadda61b459f..ab6470e8b571b 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountDeviceResponse.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountDeviceResponse.java @@ -4,21 +4,35 @@ package com.azure.resourcemanager.sphere.models; -import com.azure.resourcemanager.sphere.fluent.models.CountDeviceResponseInner; +import com.azure.core.annotation.Fluent; -/** An immutable client-side representation of CountDeviceResponse. */ -public interface CountDeviceResponse { +/** + * Response to the action call for count devices in a catalog (preview API). + */ +@Fluent +public final class CountDeviceResponse extends CountElementsResponse { /** - * Gets the value property: Number of children resources in parent resource. - * - * @return the value value. + * Creates an instance of CountDeviceResponse class. */ - int value(); + public CountDeviceResponse() { + } /** - * Gets the inner com.azure.resourcemanager.sphere.fluent.models.CountDeviceResponseInner object. - * - * @return the inner object. + * {@inheritDoc} */ - CountDeviceResponseInner innerModel(); + @Override + public CountDeviceResponse withValue(int value) { + super.withValue(value); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountDevicesResponse.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountDevicesResponse.java new file mode 100644 index 0000000000000..61ba11c3736ba --- /dev/null +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountDevicesResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sphere.models; + +import com.azure.resourcemanager.sphere.fluent.models.CountDevicesResponseInner; + +/** + * An immutable client-side representation of CountDevicesResponse. + */ +public interface CountDevicesResponse { + /** + * Gets the value property: Number of children resources in parent resource. + * + * @return the value value. + */ + int value(); + + /** + * Gets the inner com.azure.resourcemanager.sphere.fluent.models.CountDevicesResponseInner object. + * + * @return the inner object. + */ + CountDevicesResponseInner innerModel(); +} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountElementsResponse.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountElementsResponse.java index 8f716d7182f12..1c4ca678f5fe2 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountElementsResponse.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/CountElementsResponse.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Response of the count for elements. */ +/** + * Response of the count for elements. + */ @Fluent public class CountElementsResponse { /* @@ -16,13 +18,15 @@ public class CountElementsResponse { @JsonProperty(value = "value", required = true) private int value; - /** Creates an instance of CountElementsResponse class. */ + /** + * Creates an instance of CountElementsResponse class. + */ public CountElementsResponse() { } /** * Get the value property: Number of children resources in parent resource. - * + * * @return the value value. */ public int value() { @@ -31,7 +35,7 @@ public int value() { /** * Set the value property: Number of children resources in parent resource. - * + * * @param value the value value to set. * @return the CountElementsResponse object itself. */ @@ -42,7 +46,7 @@ public CountElementsResponse withValue(int value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Deployment.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Deployment.java index 52b52dcfd10bc..50a4bb9c4ac16 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Deployment.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Deployment.java @@ -4,186 +4,175 @@ package com.azure.resourcemanager.sphere.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.sphere.fluent.models.DeploymentInner; -import com.azure.resourcemanager.sphere.fluent.models.ImageInner; -import java.time.OffsetDateTime; -import java.util.List; -/** An immutable client-side representation of Deployment. */ +/** + * An immutable client-side representation of Deployment. + */ public interface Deployment { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** - * Gets the deploymentId property: Deployment ID. - * - * @return the deploymentId value. + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - String deploymentId(); + DeploymentProperties properties(); /** - * Gets the deployedImages property: Images deployed. - * - * @return the deployedImages value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - List deployedImages(); - - /** - * Gets the deploymentDateUtc property: Deployment date UTC. - * - * @return the deploymentDateUtc value. - */ - OffsetDateTime deploymentDateUtc(); - - /** - * Gets the provisioningState property: The status of the last operation. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); + SystemData systemData(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.sphere.fluent.models.DeploymentInner object. - * + * * @return the inner object. */ DeploymentInner innerModel(); - /** The entirety of the Deployment definition. */ + /** + * The entirety of the Deployment definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The Deployment definition stages. */ + /** + * The Deployment definition stages. + */ interface DefinitionStages { - /** The first stage of the Deployment definition. */ + /** + * The first stage of the Deployment definition. + */ interface Blank extends WithParentResource { } - /** The stage of the Deployment definition allowing to specify parent resource. */ + /** + * The stage of the Deployment definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, catalogName, productName, deviceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @return the next definition stage. */ - WithCreate withExistingDeviceGroup( - String resourceGroupName, String catalogName, String productName, String deviceGroupName); + WithCreate withExistingDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName); } /** * The stage of the Deployment 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 DefinitionStages.WithDeploymentId, DefinitionStages.WithDeployedImages { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. - * + * * @return the created resource. */ Deployment create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Deployment create(Context context); } - /** The stage of the Deployment definition allowing to specify deploymentId. */ - interface WithDeploymentId { - /** - * Specifies the deploymentId property: Deployment ID. - * - * @param deploymentId Deployment ID. - * @return the next definition stage. - */ - WithCreate withDeploymentId(String deploymentId); - } - - /** The stage of the Deployment definition allowing to specify deployedImages. */ - interface WithDeployedImages { + /** + * The stage of the Deployment definition allowing to specify properties. + */ + interface WithProperties { /** - * Specifies the deployedImages property: Images deployed. - * - * @param deployedImages Images deployed. + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withDeployedImages(List deployedImages); + WithCreate withProperties(DeploymentProperties properties); } } /** * Begins update for the Deployment resource. - * + * * @return the stage of resource update. */ Deployment.Update update(); - /** The template for Deployment update. */ + /** + * The template for Deployment update. + */ interface Update { /** * Executes the update request. - * + * * @return the updated resource. */ Deployment apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Deployment apply(Context context); } - /** The Deployment update stages. */ + /** + * The Deployment update stages. + */ interface UpdateStages { } /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Deployment refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeploymentListResult.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeploymentListResult.java index 6c7498792bfa5..d35e323cdcf60 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeploymentListResult.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeploymentListResult.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a Deployment list operation. */ +/** + * The response of a Deployment list operation. + */ @Fluent public final class DeploymentListResult { /* @@ -22,16 +24,18 @@ public final class DeploymentListResult { /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of DeploymentListResult class. */ + /** + * Creates an instance of DeploymentListResult class. + */ public DeploymentListResult() { } /** * Get the value property: The Deployment items on this page. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The Deployment items on this page. - * + * * @param value the value value to set. * @return the DeploymentListResult object itself. */ @@ -51,34 +55,22 @@ public DeploymentListResult withValue(List value) { /** * Get the nextLink property: The link to the next page of items. - * + * * @return the nextLink value. */ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the DeploymentListResult object itself. - */ - public DeploymentListResult 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 DeploymentListResult")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model DeploymentListResult")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeploymentProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeploymentProperties.java similarity index 90% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeploymentProperties.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeploymentProperties.java index 426c75a317fd1..301897ce51c8e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeploymentProperties.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeploymentProperties.java @@ -2,15 +2,17 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.sphere.fluent.models; +package com.azure.resourcemanager.sphere.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.sphere.models.ProvisioningState; +import com.azure.resourcemanager.sphere.fluent.models.ImageInner; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.List; -/** The properties of deployment. */ +/** + * The properties of deployment. + */ @Fluent public final class DeploymentProperties { /* @@ -37,13 +39,15 @@ public final class DeploymentProperties { @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; - /** Creates an instance of DeploymentProperties class. */ + /** + * Creates an instance of DeploymentProperties class. + */ public DeploymentProperties() { } /** * Get the deploymentId property: Deployment ID. - * + * * @return the deploymentId value. */ public String deploymentId() { @@ -52,7 +56,7 @@ public String deploymentId() { /** * Set the deploymentId property: Deployment ID. - * + * * @param deploymentId the deploymentId value to set. * @return the DeploymentProperties object itself. */ @@ -63,7 +67,7 @@ public DeploymentProperties withDeploymentId(String deploymentId) { /** * Get the deployedImages property: Images deployed. - * + * * @return the deployedImages value. */ public List deployedImages() { @@ -72,7 +76,7 @@ public List deployedImages() { /** * Set the deployedImages property: Images deployed. - * + * * @param deployedImages the deployedImages value to set. * @return the DeploymentProperties object itself. */ @@ -83,7 +87,7 @@ public DeploymentProperties withDeployedImages(List deployedImages) /** * Get the deploymentDateUtc property: Deployment date UTC. - * + * * @return the deploymentDateUtc value. */ public OffsetDateTime deploymentDateUtc() { @@ -92,7 +96,7 @@ public OffsetDateTime deploymentDateUtc() { /** * Get the provisioningState property: The status of the last operation. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -101,7 +105,7 @@ public ProvisioningState provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Deployments.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Deployments.java index 082f28f191fe7..71d8fff814d50 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Deployments.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Deployments.java @@ -8,12 +8,14 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Deployments. */ +/** + * Resource collection API of Deployments. + */ public interface Deployments { /** * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be * used for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -23,13 +25,13 @@ public interface Deployments { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a Deployment list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByDeviceGroup( - String resourceGroupName, String catalogName, String productName, String deviceGroupName); + PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName); /** * List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be * used for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -44,111 +46,85 @@ PagedIterable listByDeviceGroup( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a Deployment list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByDeviceGroup( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context); + PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String filter, Integer top, Integer skip, Integer maxpagesize, Context context); /** * Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device * group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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 Deployment along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - Context context); + Response getWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deploymentName, Context context); /** * Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device * group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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 Deployment. */ - Deployment get( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, + Deployment get(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deploymentName); /** * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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. */ - void delete( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, + void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deploymentName); /** * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @param deploymentName Deployment name. Use .default for deployment creation and to get the current deployment for - * the associated device group. + * the associated device 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. */ - void delete( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deploymentName, - Context context); + void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deploymentName, Context context); /** * Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device * group name. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -160,7 +136,7 @@ void delete( /** * Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device * group name. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -173,7 +149,7 @@ void delete( /** * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -184,7 +160,7 @@ void delete( /** * Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -195,7 +171,7 @@ void delete( /** * Begins definition for a new Deployment resource. - * + * * @param name resource name. * @return the first stage of the new Deployment definition. */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Device.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Device.java index 073290d5c9968..0228d79e48579 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Device.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Device.java @@ -4,204 +4,187 @@ package com.azure.resourcemanager.sphere.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.sphere.fluent.models.DeviceInner; -import java.time.OffsetDateTime; -/** An immutable client-side representation of Device. */ +/** + * An immutable client-side representation of Device. + */ public interface Device { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** - * Gets the deviceId property: Device ID. - * - * @return the deviceId value. + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - String deviceId(); + DeviceProperties properties(); /** - * Gets the chipSku property: SKU of the chip. - * - * @return the chipSku value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - String chipSku(); - - /** - * Gets the lastAvailableOsVersion property: OS version available for installation when update requested. - * - * @return the lastAvailableOsVersion value. - */ - String lastAvailableOsVersion(); - - /** - * Gets the lastInstalledOsVersion property: OS version running on device when update requested. - * - * @return the lastInstalledOsVersion value. - */ - String lastInstalledOsVersion(); - - /** - * Gets the lastOsUpdateUtc property: Time when update requested and new OS version available. - * - * @return the lastOsUpdateUtc value. - */ - OffsetDateTime lastOsUpdateUtc(); - - /** - * Gets the lastUpdateRequestUtc property: Time when update was last requested. - * - * @return the lastUpdateRequestUtc value. - */ - OffsetDateTime lastUpdateRequestUtc(); - - /** - * Gets the provisioningState property: The status of the last operation. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); + SystemData systemData(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.sphere.fluent.models.DeviceInner object. - * + * * @return the inner object. */ DeviceInner innerModel(); - /** The entirety of the Device definition. */ + /** + * The entirety of the Device definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The Device definition stages. */ + /** + * The Device definition stages. + */ interface DefinitionStages { - /** The first stage of the Device definition. */ + /** + * The first stage of the Device definition. + */ interface Blank extends WithParentResource { } - /** The stage of the Device definition allowing to specify parent resource. */ + /** + * The stage of the Device definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, catalogName, productName, deviceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. * @param deviceGroupName Name of device group. * @return the next definition stage. */ - WithCreate withExistingDeviceGroup( - String resourceGroupName, String catalogName, String productName, String deviceGroupName); + WithCreate withExistingDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName); } /** * The stage of the Device 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 DefinitionStages.WithDeviceId { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. - * + * * @return the created resource. */ Device create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Device create(Context context); } - /** The stage of the Device definition allowing to specify deviceId. */ - interface WithDeviceId { + /** + * The stage of the Device definition allowing to specify properties. + */ + interface WithProperties { /** - * Specifies the deviceId property: Device ID. - * - * @param deviceId Device ID. + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withDeviceId(String deviceId); + WithCreate withProperties(DeviceProperties properties); } } /** * Begins update for the Device resource. - * + * * @return the stage of resource update. */ Device.Update update(); - /** The template for Device update. */ - interface Update extends UpdateStages.WithDeviceGroupId { + /** + * The template for Device update. + */ + interface Update extends UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ Device apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Device apply(Context context); } - /** The Device update stages. */ + /** + * The Device update stages. + */ interface UpdateStages { - /** The stage of the Device update allowing to specify deviceGroupId. */ - interface WithDeviceGroupId { + /** + * The stage of the Device update allowing to specify properties. + */ + interface WithProperties { /** - * Specifies the deviceGroupId property: Device group id. - * - * @param deviceGroupId Device group id. + * Specifies the properties property: The updatable properties of the Device.. + * + * @param properties The updatable properties of the Device. * @return the next definition stage. */ - Update withDeviceGroupId(String deviceGroupId); + Update withProperties(DeviceUpdateProperties properties); } } /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Device refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -210,20 +193,20 @@ interface WithDeviceGroupId { /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product * names to generate the image for a device that does not belong to a specific device group and product. - * + * * @param generateDeviceCapabilityRequest Generate capability image 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 signed device capability image response. */ - SignedCapabilityImageResponse generateCapabilityImage( - GenerateCapabilityImageRequest generateDeviceCapabilityRequest); + SignedCapabilityImageResponse + generateCapabilityImage(GenerateCapabilityImageRequest generateDeviceCapabilityRequest); /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product * names to generate the image for a device that does not belong to a specific device group and product. - * + * * @param generateDeviceCapabilityRequest Generate capability image request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -231,6 +214,6 @@ SignedCapabilityImageResponse generateCapabilityImage( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return signed device capability image response. */ - SignedCapabilityImageResponse generateCapabilityImage( - GenerateCapabilityImageRequest generateDeviceCapabilityRequest, Context context); + SignedCapabilityImageResponse + generateCapabilityImage(GenerateCapabilityImageRequest generateDeviceCapabilityRequest, Context context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroup.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroup.java index 19be2d25dcec9..b94eba078941a 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroup.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroup.java @@ -5,111 +5,87 @@ package com.azure.resourcemanager.sphere.models; import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner; -/** An immutable client-side representation of DeviceGroup. */ +/** + * An immutable client-side representation of DeviceGroup. + */ public interface DeviceGroup { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** - * Gets the description property: Description of the device group. - * - * @return the description value. + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - String description(); + DeviceGroupProperties properties(); /** - * Gets the osFeedType property: Operating system feed type of the device group. - * - * @return the osFeedType value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - OSFeedType osFeedType(); - - /** - * Gets the updatePolicy property: Update policy of the device group. - * - * @return the updatePolicy value. - */ - UpdatePolicy updatePolicy(); - - /** - * Gets the allowCrashDumpsCollection property: Flag to define if the user allows for crash dump collection. - * - * @return the allowCrashDumpsCollection value. - */ - AllowCrashDumpCollection allowCrashDumpsCollection(); - - /** - * Gets the regionalDataBoundary property: Regional data boundary for the device group. - * - * @return the regionalDataBoundary value. - */ - RegionalDataBoundary regionalDataBoundary(); - - /** - * Gets the hasDeployment property: Deployment status for the device group. - * - * @return the hasDeployment value. - */ - Boolean hasDeployment(); - - /** - * Gets the provisioningState property: The status of the last operation. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); + SystemData systemData(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner object. - * + * * @return the inner object. */ DeviceGroupInner innerModel(); - /** The entirety of the DeviceGroup definition. */ + /** + * The entirety of the DeviceGroup definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The DeviceGroup definition stages. */ + /** + * The DeviceGroup definition stages. + */ interface DefinitionStages { - /** The first stage of the DeviceGroup definition. */ + /** + * The first stage of the DeviceGroup definition. + */ interface Blank extends WithParentResource { } - /** The stage of the DeviceGroup definition allowing to specify parent resource. */ + /** + * The stage of the DeviceGroup definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, catalogName, productName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -122,184 +98,92 @@ interface WithParentResource { * The stage of the DeviceGroup 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 DefinitionStages.WithDescription, - DefinitionStages.WithOsFeedType, - DefinitionStages.WithUpdatePolicy, - DefinitionStages.WithAllowCrashDumpsCollection, - DefinitionStages.WithRegionalDataBoundary { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. - * + * * @return the created resource. */ DeviceGroup create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ DeviceGroup create(Context context); } - /** The stage of the DeviceGroup definition allowing to specify description. */ - interface WithDescription { - /** - * Specifies the description property: Description of the device group.. - * - * @param description Description of the device group. - * @return the next definition stage. - */ - WithCreate withDescription(String description); - } - - /** The stage of the DeviceGroup definition allowing to specify osFeedType. */ - interface WithOsFeedType { - /** - * Specifies the osFeedType property: Operating system feed type of the device group.. - * - * @param osFeedType Operating system feed type of the device group. - * @return the next definition stage. - */ - WithCreate withOsFeedType(OSFeedType osFeedType); - } - - /** The stage of the DeviceGroup definition allowing to specify updatePolicy. */ - interface WithUpdatePolicy { - /** - * Specifies the updatePolicy property: Update policy of the device group.. - * - * @param updatePolicy Update policy of the device group. - * @return the next definition stage. - */ - WithCreate withUpdatePolicy(UpdatePolicy updatePolicy); - } - - /** The stage of the DeviceGroup definition allowing to specify allowCrashDumpsCollection. */ - interface WithAllowCrashDumpsCollection { - /** - * Specifies the allowCrashDumpsCollection property: Flag to define if the user allows for crash dump - * collection.. - * - * @param allowCrashDumpsCollection Flag to define if the user allows for crash dump collection. - * @return the next definition stage. - */ - WithCreate withAllowCrashDumpsCollection(AllowCrashDumpCollection allowCrashDumpsCollection); - } - - /** The stage of the DeviceGroup definition allowing to specify regionalDataBoundary. */ - interface WithRegionalDataBoundary { + /** + * The stage of the DeviceGroup definition allowing to specify properties. + */ + interface WithProperties { /** - * Specifies the regionalDataBoundary property: Regional data boundary for the device group.. - * - * @param regionalDataBoundary Regional data boundary for the device group. + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withRegionalDataBoundary(RegionalDataBoundary regionalDataBoundary); + WithCreate withProperties(DeviceGroupProperties properties); } } /** * Begins update for the DeviceGroup resource. - * + * * @return the stage of resource update. */ DeviceGroup.Update update(); - /** The template for DeviceGroup update. */ - interface Update - extends UpdateStages.WithDescription, - UpdateStages.WithOsFeedType, - UpdateStages.WithUpdatePolicy, - UpdateStages.WithAllowCrashDumpsCollection, - UpdateStages.WithRegionalDataBoundary { + /** + * The template for DeviceGroup update. + */ + interface Update extends UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ DeviceGroup apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ DeviceGroup apply(Context context); } - /** The DeviceGroup update stages. */ + /** + * The DeviceGroup update stages. + */ interface UpdateStages { - /** The stage of the DeviceGroup update allowing to specify description. */ - interface WithDescription { - /** - * Specifies the description property: Description of the device group.. - * - * @param description Description of the device group. - * @return the next definition stage. - */ - Update withDescription(String description); - } - - /** The stage of the DeviceGroup update allowing to specify osFeedType. */ - interface WithOsFeedType { - /** - * Specifies the osFeedType property: Operating system feed type of the device group.. - * - * @param osFeedType Operating system feed type of the device group. - * @return the next definition stage. - */ - Update withOsFeedType(OSFeedType osFeedType); - } - - /** The stage of the DeviceGroup update allowing to specify updatePolicy. */ - interface WithUpdatePolicy { - /** - * Specifies the updatePolicy property: Update policy of the device group.. - * - * @param updatePolicy Update policy of the device group. - * @return the next definition stage. - */ - Update withUpdatePolicy(UpdatePolicy updatePolicy); - } - - /** The stage of the DeviceGroup update allowing to specify allowCrashDumpsCollection. */ - interface WithAllowCrashDumpsCollection { - /** - * Specifies the allowCrashDumpsCollection property: Flag to define if the user allows for crash dump - * collection.. - * - * @param allowCrashDumpsCollection Flag to define if the user allows for crash dump collection. - * @return the next definition stage. - */ - Update withAllowCrashDumpsCollection(AllowCrashDumpCollection allowCrashDumpsCollection); - } - - /** The stage of the DeviceGroup update allowing to specify regionalDataBoundary. */ - interface WithRegionalDataBoundary { + /** + * The stage of the DeviceGroup update allowing to specify properties. + */ + interface WithProperties { /** - * Specifies the regionalDataBoundary property: Regional data boundary for the device group.. - * - * @param regionalDataBoundary Regional data boundary for the device group. + * Specifies the properties property: The updatable properties of the DeviceGroup.. + * + * @param properties The updatable properties of the DeviceGroup. * @return the next definition stage. */ - Update withRegionalDataBoundary(RegionalDataBoundary regionalDataBoundary); + Update withProperties(DeviceGroupUpdateProperties properties); } } /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ DeviceGroup refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -308,7 +192,7 @@ interface WithRegionalDataBoundary { /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk * claiming devices to a catalog only. - * + * * @param claimDevicesRequest Bulk claim devices 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. @@ -319,7 +203,7 @@ interface WithRegionalDataBoundary { /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk * claiming devices to a catalog only. - * + * * @param claimDevicesRequest Bulk claim devices request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -331,22 +215,22 @@ interface WithRegionalDataBoundary { /** * Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for * product or device 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 response to the action call for count devices in a catalog along with {@link Response}. */ - Response countDevicesWithResponse(Context context); + Response countDevicesWithResponse(Context context); /** * Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for * product or device group name. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response to the action call for count devices in a catalog. */ - CountDeviceResponse countDevices(); + CountDevicesResponse countDevices(); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupListResult.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupListResult.java index 5010b57a9b072..c84c197fd3755 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupListResult.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupListResult.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a DeviceGroup list operation. */ +/** + * The response of a DeviceGroup list operation. + */ @Fluent public final class DeviceGroupListResult { /* @@ -22,16 +24,18 @@ public final class DeviceGroupListResult { /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of DeviceGroupListResult class. */ + /** + * Creates an instance of DeviceGroupListResult class. + */ public DeviceGroupListResult() { } /** * Get the value property: The DeviceGroup items on this page. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The DeviceGroup items on this page. - * + * * @param value the value value to set. * @return the DeviceGroupListResult object itself. */ @@ -51,34 +55,22 @@ public DeviceGroupListResult withValue(List value) { /** * Get the nextLink property: The link to the next page of items. - * + * * @return the nextLink value. */ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the DeviceGroupListResult object itself. - */ - public DeviceGroupListResult 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 DeviceGroupListResult")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model DeviceGroupListResult")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceGroupProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupProperties.java similarity index 90% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceGroupProperties.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupProperties.java index dfab130e9fa89..007e5cbf4de8e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceGroupProperties.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupProperties.java @@ -2,17 +2,14 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.sphere.fluent.models; +package com.azure.resourcemanager.sphere.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; -import com.azure.resourcemanager.sphere.models.OSFeedType; -import com.azure.resourcemanager.sphere.models.ProvisioningState; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import com.azure.resourcemanager.sphere.models.UpdatePolicy; import com.fasterxml.jackson.annotation.JsonProperty; -/** The properties of deviceGroup. */ +/** + * The properties of deviceGroup. + */ @Fluent public final class DeviceGroupProperties { /* @@ -57,13 +54,15 @@ public final class DeviceGroupProperties { @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; - /** Creates an instance of DeviceGroupProperties class. */ + /** + * Creates an instance of DeviceGroupProperties class. + */ public DeviceGroupProperties() { } /** * Get the description property: Description of the device group. - * + * * @return the description value. */ public String description() { @@ -72,7 +71,7 @@ public String description() { /** * Set the description property: Description of the device group. - * + * * @param description the description value to set. * @return the DeviceGroupProperties object itself. */ @@ -83,7 +82,7 @@ public DeviceGroupProperties withDescription(String description) { /** * Get the osFeedType property: Operating system feed type of the device group. - * + * * @return the osFeedType value. */ public OSFeedType osFeedType() { @@ -92,7 +91,7 @@ public OSFeedType osFeedType() { /** * Set the osFeedType property: Operating system feed type of the device group. - * + * * @param osFeedType the osFeedType value to set. * @return the DeviceGroupProperties object itself. */ @@ -103,7 +102,7 @@ public DeviceGroupProperties withOsFeedType(OSFeedType osFeedType) { /** * Get the updatePolicy property: Update policy of the device group. - * + * * @return the updatePolicy value. */ public UpdatePolicy updatePolicy() { @@ -112,7 +111,7 @@ public UpdatePolicy updatePolicy() { /** * Set the updatePolicy property: Update policy of the device group. - * + * * @param updatePolicy the updatePolicy value to set. * @return the DeviceGroupProperties object itself. */ @@ -123,7 +122,7 @@ public DeviceGroupProperties withUpdatePolicy(UpdatePolicy updatePolicy) { /** * Get the allowCrashDumpsCollection property: Flag to define if the user allows for crash dump collection. - * + * * @return the allowCrashDumpsCollection value. */ public AllowCrashDumpCollection allowCrashDumpsCollection() { @@ -132,7 +131,7 @@ public AllowCrashDumpCollection allowCrashDumpsCollection() { /** * Set the allowCrashDumpsCollection property: Flag to define if the user allows for crash dump collection. - * + * * @param allowCrashDumpsCollection the allowCrashDumpsCollection value to set. * @return the DeviceGroupProperties object itself. */ @@ -143,7 +142,7 @@ public DeviceGroupProperties withAllowCrashDumpsCollection(AllowCrashDumpCollect /** * Get the regionalDataBoundary property: Regional data boundary for the device group. - * + * * @return the regionalDataBoundary value. */ public RegionalDataBoundary regionalDataBoundary() { @@ -152,7 +151,7 @@ public RegionalDataBoundary regionalDataBoundary() { /** * Set the regionalDataBoundary property: Regional data boundary for the device group. - * + * * @param regionalDataBoundary the regionalDataBoundary value to set. * @return the DeviceGroupProperties object itself. */ @@ -163,7 +162,7 @@ public DeviceGroupProperties withRegionalDataBoundary(RegionalDataBoundary regio /** * Get the hasDeployment property: Deployment status for the device group. - * + * * @return the hasDeployment value. */ public Boolean hasDeployment() { @@ -172,7 +171,7 @@ public Boolean hasDeployment() { /** * Get the provisioningState property: The status of the last operation. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -181,7 +180,7 @@ public ProvisioningState provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupUpdate.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupUpdate.java index b29005860436c..6b8a3dedd1714 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupUpdate.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupUpdate.java @@ -5,154 +5,53 @@ package com.azure.resourcemanager.sphere.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupUpdateProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** The type used for update operations of the DeviceGroup. */ +/** + * The type used for update operations of the DeviceGroup. + */ @Fluent public final class DeviceGroupUpdate { /* * The updatable properties of the DeviceGroup. */ @JsonProperty(value = "properties") - private DeviceGroupUpdateProperties innerProperties; - - /** Creates an instance of DeviceGroupUpdate class. */ - public DeviceGroupUpdate() { - } - - /** - * Get the innerProperties property: The updatable properties of the DeviceGroup. - * - * @return the innerProperties value. - */ - private DeviceGroupUpdateProperties innerProperties() { - return this.innerProperties; - } + private DeviceGroupUpdateProperties properties; /** - * Get the description property: Description of the device group. - * - * @return the description value. + * Creates an instance of DeviceGroupUpdate class. */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Description of the device group. - * - * @param description the description value to set. - * @return the DeviceGroupUpdate object itself. - */ - public DeviceGroupUpdate withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceGroupUpdateProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the osFeedType property: Operating system feed type of the device group. - * - * @return the osFeedType value. - */ - public OSFeedType osFeedType() { - return this.innerProperties() == null ? null : this.innerProperties().osFeedType(); - } - - /** - * Set the osFeedType property: Operating system feed type of the device group. - * - * @param osFeedType the osFeedType value to set. - * @return the DeviceGroupUpdate object itself. - */ - public DeviceGroupUpdate withOsFeedType(OSFeedType osFeedType) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceGroupUpdateProperties(); - } - this.innerProperties().withOsFeedType(osFeedType); - return this; - } - - /** - * Get the updatePolicy property: Update policy of the device group. - * - * @return the updatePolicy value. - */ - public UpdatePolicy updatePolicy() { - return this.innerProperties() == null ? null : this.innerProperties().updatePolicy(); - } - - /** - * Set the updatePolicy property: Update policy of the device group. - * - * @param updatePolicy the updatePolicy value to set. - * @return the DeviceGroupUpdate object itself. - */ - public DeviceGroupUpdate withUpdatePolicy(UpdatePolicy updatePolicy) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceGroupUpdateProperties(); - } - this.innerProperties().withUpdatePolicy(updatePolicy); - return this; - } - - /** - * Get the allowCrashDumpsCollection property: Flag to define if the user allows for crash dump collection. - * - * @return the allowCrashDumpsCollection value. - */ - public AllowCrashDumpCollection allowCrashDumpsCollection() { - return this.innerProperties() == null ? null : this.innerProperties().allowCrashDumpsCollection(); - } - - /** - * Set the allowCrashDumpsCollection property: Flag to define if the user allows for crash dump collection. - * - * @param allowCrashDumpsCollection the allowCrashDumpsCollection value to set. - * @return the DeviceGroupUpdate object itself. - */ - public DeviceGroupUpdate withAllowCrashDumpsCollection(AllowCrashDumpCollection allowCrashDumpsCollection) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceGroupUpdateProperties(); - } - this.innerProperties().withAllowCrashDumpsCollection(allowCrashDumpsCollection); - return this; + public DeviceGroupUpdate() { } /** - * Get the regionalDataBoundary property: Regional data boundary for the device group. - * - * @return the regionalDataBoundary value. + * Get the properties property: The updatable properties of the DeviceGroup. + * + * @return the properties value. */ - public RegionalDataBoundary regionalDataBoundary() { - return this.innerProperties() == null ? null : this.innerProperties().regionalDataBoundary(); + public DeviceGroupUpdateProperties properties() { + return this.properties; } /** - * Set the regionalDataBoundary property: Regional data boundary for the device group. - * - * @param regionalDataBoundary the regionalDataBoundary value to set. + * Set the properties property: The updatable properties of the DeviceGroup. + * + * @param properties the properties value to set. * @return the DeviceGroupUpdate object itself. */ - public DeviceGroupUpdate withRegionalDataBoundary(RegionalDataBoundary regionalDataBoundary) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceGroupUpdateProperties(); - } - this.innerProperties().withRegionalDataBoundary(regionalDataBoundary); + public DeviceGroupUpdate withProperties(DeviceGroupUpdateProperties properties) { + this.properties = properties; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceGroupUpdateProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupUpdateProperties.java similarity index 87% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceGroupUpdateProperties.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupUpdateProperties.java index 055f245fd2369..0761b1534557d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceGroupUpdateProperties.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroupUpdateProperties.java @@ -2,16 +2,14 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.sphere.fluent.models; +package com.azure.resourcemanager.sphere.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; -import com.azure.resourcemanager.sphere.models.OSFeedType; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; -import com.azure.resourcemanager.sphere.models.UpdatePolicy; import com.fasterxml.jackson.annotation.JsonProperty; -/** The updatable properties of the DeviceGroup. */ +/** + * The updatable properties of the DeviceGroup. + */ @Fluent public final class DeviceGroupUpdateProperties { /* @@ -44,13 +42,15 @@ public final class DeviceGroupUpdateProperties { @JsonProperty(value = "regionalDataBoundary") private RegionalDataBoundary regionalDataBoundary; - /** Creates an instance of DeviceGroupUpdateProperties class. */ + /** + * Creates an instance of DeviceGroupUpdateProperties class. + */ public DeviceGroupUpdateProperties() { } /** * Get the description property: Description of the device group. - * + * * @return the description value. */ public String description() { @@ -59,7 +59,7 @@ public String description() { /** * Set the description property: Description of the device group. - * + * * @param description the description value to set. * @return the DeviceGroupUpdateProperties object itself. */ @@ -70,7 +70,7 @@ public DeviceGroupUpdateProperties withDescription(String description) { /** * Get the osFeedType property: Operating system feed type of the device group. - * + * * @return the osFeedType value. */ public OSFeedType osFeedType() { @@ -79,7 +79,7 @@ public OSFeedType osFeedType() { /** * Set the osFeedType property: Operating system feed type of the device group. - * + * * @param osFeedType the osFeedType value to set. * @return the DeviceGroupUpdateProperties object itself. */ @@ -90,7 +90,7 @@ public DeviceGroupUpdateProperties withOsFeedType(OSFeedType osFeedType) { /** * Get the updatePolicy property: Update policy of the device group. - * + * * @return the updatePolicy value. */ public UpdatePolicy updatePolicy() { @@ -99,7 +99,7 @@ public UpdatePolicy updatePolicy() { /** * Set the updatePolicy property: Update policy of the device group. - * + * * @param updatePolicy the updatePolicy value to set. * @return the DeviceGroupUpdateProperties object itself. */ @@ -110,7 +110,7 @@ public DeviceGroupUpdateProperties withUpdatePolicy(UpdatePolicy updatePolicy) { /** * Get the allowCrashDumpsCollection property: Flag to define if the user allows for crash dump collection. - * + * * @return the allowCrashDumpsCollection value. */ public AllowCrashDumpCollection allowCrashDumpsCollection() { @@ -119,19 +119,19 @@ public AllowCrashDumpCollection allowCrashDumpsCollection() { /** * Set the allowCrashDumpsCollection property: Flag to define if the user allows for crash dump collection. - * + * * @param allowCrashDumpsCollection the allowCrashDumpsCollection value to set. * @return the DeviceGroupUpdateProperties object itself. */ - public DeviceGroupUpdateProperties withAllowCrashDumpsCollection( - AllowCrashDumpCollection allowCrashDumpsCollection) { + public DeviceGroupUpdateProperties + withAllowCrashDumpsCollection(AllowCrashDumpCollection allowCrashDumpsCollection) { this.allowCrashDumpsCollection = allowCrashDumpsCollection; return this; } /** * Get the regionalDataBoundary property: Regional data boundary for the device group. - * + * * @return the regionalDataBoundary value. */ public RegionalDataBoundary regionalDataBoundary() { @@ -140,7 +140,7 @@ public RegionalDataBoundary regionalDataBoundary() { /** * Set the regionalDataBoundary property: Regional data boundary for the device group. - * + * * @param regionalDataBoundary the regionalDataBoundary value to set. * @return the DeviceGroupUpdateProperties object itself. */ @@ -151,7 +151,7 @@ public DeviceGroupUpdateProperties withRegionalDataBoundary(RegionalDataBoundary /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroups.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroups.java index ece2c86ce5a7b..afed0f5f9dd90 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroups.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceGroups.java @@ -8,12 +8,14 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of DeviceGroups. */ +/** + * Resource collection API of DeviceGroups. + */ public interface DeviceGroups { /** * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used * for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -27,7 +29,7 @@ public interface DeviceGroups { /** * List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used * for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -41,20 +43,13 @@ public interface DeviceGroups { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByProduct( - String resourceGroupName, - String catalogName, - String productName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context); + PagedIterable listByProduct(String resourceGroupName, String catalogName, String productName, + String filter, Integer top, Integer skip, Integer maxpagesize, Context context); /** * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -65,13 +60,13 @@ PagedIterable listByProduct( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a DeviceGroup along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context); + Response getWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, Context context); /** * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -86,7 +81,7 @@ Response getWithResponse( /** * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -100,7 +95,7 @@ Response getWithResponse( /** * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -110,13 +105,13 @@ Response getWithResponse( * @throws com.azure.core.management.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 catalogName, String productName, String deviceGroupName, Context context); + void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + Context context); /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk * claiming devices to a catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -126,17 +121,13 @@ void delete( * @throws com.azure.core.management.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 claimDevices( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, + void claimDevices(String resourceGroupName, String catalogName, String productName, String deviceGroupName, ClaimDevicesRequest claimDevicesRequest); /** * Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk * claiming devices to a catalog only. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -147,18 +138,13 @@ void claimDevices( * @throws com.azure.core.management.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 claimDevices( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - ClaimDevicesRequest claimDevicesRequest, - Context context); + void claimDevices(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + ClaimDevicesRequest claimDevicesRequest, Context context); /** * Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for * product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -169,13 +155,13 @@ void claimDevices( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response to the action call for count devices in a catalog along with {@link Response}. */ - Response countDevicesWithResponse( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context); + Response countDevicesWithResponse(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, Context context); /** * Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for * product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -185,13 +171,13 @@ Response countDevicesWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response to the action call for count devices in a catalog. */ - CountDeviceResponse countDevices( - String resourceGroupName, String catalogName, String productName, String deviceGroupName); + CountDevicesResponse countDevices(String resourceGroupName, String catalogName, String productName, + String deviceGroupName); /** * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -203,7 +189,7 @@ CountDeviceResponse countDevices( /** * Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -216,7 +202,7 @@ CountDeviceResponse countDevices( /** * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -227,7 +213,7 @@ CountDeviceResponse countDevices( /** * Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or * device group name. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -238,7 +224,7 @@ CountDeviceResponse countDevices( /** * Begins definition for a new DeviceGroup resource. - * + * * @param name resource name. * @return the first stage of the new DeviceGroup definition. */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceInsight.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceInsight.java index adf199386321d..1ddc5e3df51f6 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceInsight.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceInsight.java @@ -7,67 +7,69 @@ import com.azure.resourcemanager.sphere.fluent.models.DeviceInsightInner; import java.time.OffsetDateTime; -/** An immutable client-side representation of DeviceInsight. */ +/** + * An immutable client-side representation of DeviceInsight. + */ public interface DeviceInsight { /** * Gets the deviceId property: Device ID. - * + * * @return the deviceId value. */ String deviceId(); /** * Gets the description property: Event description. - * + * * @return the description value. */ String description(); /** * Gets the startTimestampUtc property: Event start timestamp. - * + * * @return the startTimestampUtc value. */ OffsetDateTime startTimestampUtc(); /** * Gets the endTimestampUtc property: Event end timestamp. - * + * * @return the endTimestampUtc value. */ OffsetDateTime endTimestampUtc(); /** * Gets the eventCategory property: Event category. - * + * * @return the eventCategory value. */ String eventCategory(); /** * Gets the eventClass property: Event class. - * + * * @return the eventClass value. */ String eventClass(); /** * Gets the eventType property: Event type. - * + * * @return the eventType value. */ String eventType(); /** * Gets the eventCount property: Event count. - * + * * @return the eventCount value. */ int eventCount(); /** * Gets the inner com.azure.resourcemanager.sphere.fluent.models.DeviceInsightInner object. - * + * * @return the inner object. */ DeviceInsightInner innerModel(); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceListResult.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceListResult.java index 5f6ddd913eec1..731fcd4e2491c 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceListResult.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceListResult.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a Device list operation. */ +/** + * The response of a Device list operation. + */ @Fluent public final class DeviceListResult { /* @@ -22,16 +24,18 @@ public final class DeviceListResult { /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of DeviceListResult class. */ + /** + * Creates an instance of DeviceListResult class. + */ public DeviceListResult() { } /** * Get the value property: The Device items on this page. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The Device items on this page. - * + * * @param value the value value to set. * @return the DeviceListResult object itself. */ @@ -51,34 +55,22 @@ public DeviceListResult withValue(List value) { /** * Get the nextLink property: The link to the next page of items. - * + * * @return the nextLink value. */ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the DeviceListResult object itself. - */ - public DeviceListResult 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 DeviceListResult")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model DeviceListResult")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceProperties.java similarity index 93% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceProperties.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceProperties.java index 007b9a67c80d8..0367cccef4a0a 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceProperties.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceProperties.java @@ -2,14 +2,15 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.sphere.fluent.models; +package com.azure.resourcemanager.sphere.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.sphere.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; -/** The properties of device. */ +/** + * The properties of device. + */ @Fluent public final class DeviceProperties { /* @@ -54,13 +55,15 @@ public final class DeviceProperties { @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; - /** Creates an instance of DeviceProperties class. */ + /** + * Creates an instance of DeviceProperties class. + */ public DeviceProperties() { } /** * Get the deviceId property: Device ID. - * + * * @return the deviceId value. */ public String deviceId() { @@ -69,7 +72,7 @@ public String deviceId() { /** * Set the deviceId property: Device ID. - * + * * @param deviceId the deviceId value to set. * @return the DeviceProperties object itself. */ @@ -80,7 +83,7 @@ public DeviceProperties withDeviceId(String deviceId) { /** * Get the chipSku property: SKU of the chip. - * + * * @return the chipSku value. */ public String chipSku() { @@ -89,7 +92,7 @@ public String chipSku() { /** * Get the lastAvailableOsVersion property: OS version available for installation when update requested. - * + * * @return the lastAvailableOsVersion value. */ public String lastAvailableOsVersion() { @@ -98,7 +101,7 @@ public String lastAvailableOsVersion() { /** * Get the lastInstalledOsVersion property: OS version running on device when update requested. - * + * * @return the lastInstalledOsVersion value. */ public String lastInstalledOsVersion() { @@ -107,7 +110,7 @@ public String lastInstalledOsVersion() { /** * Get the lastOsUpdateUtc property: Time when update requested and new OS version available. - * + * * @return the lastOsUpdateUtc value. */ public OffsetDateTime lastOsUpdateUtc() { @@ -116,7 +119,7 @@ public OffsetDateTime lastOsUpdateUtc() { /** * Get the lastUpdateRequestUtc property: Time when update was last requested. - * + * * @return the lastUpdateRequestUtc value. */ public OffsetDateTime lastUpdateRequestUtc() { @@ -125,7 +128,7 @@ public OffsetDateTime lastUpdateRequestUtc() { /** * Get the provisioningState property: The status of the last operation. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -134,7 +137,7 @@ public ProvisioningState provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceUpdate.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceUpdate.java index 9217bec762a3a..513a2533d53e6 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceUpdate.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceUpdate.java @@ -5,62 +5,53 @@ package com.azure.resourcemanager.sphere.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.sphere.fluent.models.DeviceUpdateProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** The type used for update operations of the Device. */ +/** + * The type used for update operations of the Device. + */ @Fluent public final class DeviceUpdate { /* * The updatable properties of the Device. */ @JsonProperty(value = "properties") - private DeviceUpdateProperties innerProperties; - - /** Creates an instance of DeviceUpdate class. */ - public DeviceUpdate() { - } + private DeviceUpdateProperties properties; /** - * Get the innerProperties property: The updatable properties of the Device. - * - * @return the innerProperties value. + * Creates an instance of DeviceUpdate class. */ - private DeviceUpdateProperties innerProperties() { - return this.innerProperties; + public DeviceUpdate() { } /** - * Get the deviceGroupId property: Device group id. - * - * @return the deviceGroupId value. + * Get the properties property: The updatable properties of the Device. + * + * @return the properties value. */ - public String deviceGroupId() { - return this.innerProperties() == null ? null : this.innerProperties().deviceGroupId(); + public DeviceUpdateProperties properties() { + return this.properties; } /** - * Set the deviceGroupId property: Device group id. - * - * @param deviceGroupId the deviceGroupId value to set. + * Set the properties property: The updatable properties of the Device. + * + * @param properties the properties value to set. * @return the DeviceUpdate object itself. */ - public DeviceUpdate withDeviceGroupId(String deviceGroupId) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceUpdateProperties(); - } - this.innerProperties().withDeviceGroupId(deviceGroupId); + public DeviceUpdate withProperties(DeviceUpdateProperties properties) { + this.properties = properties; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceUpdateProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceUpdateProperties.java similarity index 85% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceUpdateProperties.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceUpdateProperties.java index d89b5654acf6a..9b6696d7d517d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/DeviceUpdateProperties.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/DeviceUpdateProperties.java @@ -2,12 +2,14 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.sphere.fluent.models; +package com.azure.resourcemanager.sphere.models; import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The updatable properties of the Device. */ +/** + * The updatable properties of the Device. + */ @Fluent public final class DeviceUpdateProperties { /* @@ -16,13 +18,15 @@ public final class DeviceUpdateProperties { @JsonProperty(value = "deviceGroupId") private String deviceGroupId; - /** Creates an instance of DeviceUpdateProperties class. */ + /** + * Creates an instance of DeviceUpdateProperties class. + */ public DeviceUpdateProperties() { } /** * Get the deviceGroupId property: Device group id. - * + * * @return the deviceGroupId value. */ public String deviceGroupId() { @@ -31,7 +35,7 @@ public String deviceGroupId() { /** * Set the deviceGroupId property: Device group id. - * + * * @param deviceGroupId the deviceGroupId value to set. * @return the DeviceUpdateProperties object itself. */ @@ -42,7 +46,7 @@ public DeviceUpdateProperties withDeviceGroupId(String deviceGroupId) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Devices.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Devices.java index 120b73eaa9d46..ef2bd6c513eeb 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Devices.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Devices.java @@ -8,12 +8,14 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Devices. */ +/** + * Resource collection API of Devices. + */ public interface Devices { /** * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used * for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -23,13 +25,13 @@ public interface Devices { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a Device list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByDeviceGroup( - String resourceGroupName, String catalogName, String productName, String deviceGroupName); + PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName); /** * List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used * for product or device group name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -40,13 +42,13 @@ PagedIterable listByDeviceGroup( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a Device list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByDeviceGroup( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, Context context); + PagedIterable listByDeviceGroup(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, Context context); /** * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not * belong to a device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -58,18 +60,13 @@ PagedIterable listByDeviceGroup( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Device along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - Context context); + Response getWithResponse(String resourceGroupName, String catalogName, String productName, + String deviceGroupName, String deviceName, Context context); /** * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not * belong to a device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -80,12 +77,12 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Device. */ - Device get( - String resourceGroupName, String catalogName, String productName, String deviceGroupName, String deviceName); + Device get(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName); /** * Delete a Device. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -95,12 +92,12 @@ Device get( * @throws com.azure.core.management.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 catalogName, String productName, String deviceGroupName, String deviceName); + void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName); /** * Delete a Device. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -111,18 +108,13 @@ void delete( * @throws com.azure.core.management.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 catalogName, - String productName, - String deviceGroupName, - String deviceName, - Context context); + void delete(String resourceGroupName, String catalogName, String productName, String deviceGroupName, + String deviceName, Context context); /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product * names to generate the image for a device that does not belong to a specific device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -134,18 +126,14 @@ void delete( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return signed device capability image response. */ - SignedCapabilityImageResponse generateCapabilityImage( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, + SignedCapabilityImageResponse generateCapabilityImage(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, GenerateCapabilityImageRequest generateDeviceCapabilityRequest); /** * Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product * names to generate the image for a device that does not belong to a specific device group and product. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -158,19 +146,14 @@ SignedCapabilityImageResponse generateCapabilityImage( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return signed device capability image response. */ - SignedCapabilityImageResponse generateCapabilityImage( - String resourceGroupName, - String catalogName, - String productName, - String deviceGroupName, - String deviceName, - GenerateCapabilityImageRequest generateDeviceCapabilityRequest, - Context context); + SignedCapabilityImageResponse generateCapabilityImage(String resourceGroupName, String catalogName, + String productName, String deviceGroupName, String deviceName, + GenerateCapabilityImageRequest generateDeviceCapabilityRequest, Context context); /** * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not * belong to a device group and product. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -182,7 +165,7 @@ SignedCapabilityImageResponse generateCapabilityImage( /** * Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not * belong to a device group and product. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -194,7 +177,7 @@ SignedCapabilityImageResponse generateCapabilityImage( /** * Delete a Device. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -204,7 +187,7 @@ SignedCapabilityImageResponse generateCapabilityImage( /** * Delete a Device. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -215,7 +198,7 @@ SignedCapabilityImageResponse generateCapabilityImage( /** * Begins definition for a new Device resource. - * + * * @param name resource name. * @return the first stage of the new Device definition. */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/GenerateCapabilityImageRequest.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/GenerateCapabilityImageRequest.java index e795eb1a071e1..149670e052b4d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/GenerateCapabilityImageRequest.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/GenerateCapabilityImageRequest.java @@ -9,7 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Request of the action to create a signed device capability image. */ +/** + * Request of the action to create a signed device capability image. + */ @Fluent public final class GenerateCapabilityImageRequest { /* @@ -18,13 +20,15 @@ public final class GenerateCapabilityImageRequest { @JsonProperty(value = "capabilities", required = true) private List capabilities; - /** Creates an instance of GenerateCapabilityImageRequest class. */ + /** + * Creates an instance of GenerateCapabilityImageRequest class. + */ public GenerateCapabilityImageRequest() { } /** * Get the capabilities property: List of capabilities to create. - * + * * @return the capabilities value. */ public List capabilities() { @@ -33,7 +37,7 @@ public List capabilities() { /** * Set the capabilities property: List of capabilities to create. - * + * * @param capabilities the capabilities value to set. * @return the GenerateCapabilityImageRequest object itself. */ @@ -44,15 +48,13 @@ public GenerateCapabilityImageRequest withCapabilities(List capa /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (capabilities() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property capabilities in model GenerateCapabilityImageRequest")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property capabilities in model GenerateCapabilityImageRequest")); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Image.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Image.java index 03c294f282cfb..c9834ae799a37 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Image.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Image.java @@ -4,126 +4,87 @@ package com.azure.resourcemanager.sphere.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.sphere.fluent.models.ImageInner; -/** An immutable client-side representation of Image. */ +/** + * An immutable client-side representation of Image. + */ public interface Image { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** - * Gets the image property: Image as a UTF-8 encoded base 64 string on image create. This field contains the image - * URI on image reads. - * - * @return the image value. + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - String image(); + ImageProperties properties(); /** - * Gets the imageId property: Image ID. - * - * @return the imageId value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - String imageId(); - - /** - * Gets the imageName property: Image name. - * - * @return the imageName value. - */ - String imageName(); - - /** - * Gets the regionalDataBoundary property: Regional data boundary for an image. - * - * @return the regionalDataBoundary value. - */ - RegionalDataBoundary regionalDataBoundary(); - - /** - * Gets the uri property: Location the image. - * - * @return the uri value. - */ - String uri(); - - /** - * Gets the description property: The image description. - * - * @return the description value. - */ - String description(); - - /** - * Gets the componentId property: The image component id. - * - * @return the componentId value. - */ - String componentId(); - - /** - * Gets the imageType property: The image type. - * - * @return the imageType value. - */ - ImageType imageType(); - - /** - * Gets the provisioningState property: The status of the last operation. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); + SystemData systemData(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.sphere.fluent.models.ImageInner object. - * + * * @return the inner object. */ ImageInner innerModel(); - /** The entirety of the Image definition. */ + /** + * The entirety of the Image definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The Image definition stages. */ + /** + * The Image definition stages. + */ interface DefinitionStages { - /** The first stage of the Image definition. */ + /** + * The first stage of the Image definition. + */ interface Blank extends WithParentResource { } - /** The stage of the Image definition allowing to specify parent resource. */ + /** + * The stage of the Image definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, catalogName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @return the next definition stage. @@ -135,101 +96,80 @@ interface WithParentResource { * The stage of the Image 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 DefinitionStages.WithImage, - DefinitionStages.WithImageId, - DefinitionStages.WithRegionalDataBoundary { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. - * + * * @return the created resource. */ Image create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Image create(Context context); } - /** The stage of the Image definition allowing to specify image. */ - interface WithImage { - /** - * Specifies the image property: Image as a UTF-8 encoded base 64 string on image create. This field - * contains the image URI on image reads.. - * - * @param image Image as a UTF-8 encoded base 64 string on image create. This field contains the image URI - * on image reads. - * @return the next definition stage. - */ - WithCreate withImage(String image); - } - - /** The stage of the Image definition allowing to specify imageId. */ - interface WithImageId { - /** - * Specifies the imageId property: Image ID. - * - * @param imageId Image ID. - * @return the next definition stage. - */ - WithCreate withImageId(String imageId); - } - - /** The stage of the Image definition allowing to specify regionalDataBoundary. */ - interface WithRegionalDataBoundary { + /** + * The stage of the Image definition allowing to specify properties. + */ + interface WithProperties { /** - * Specifies the regionalDataBoundary property: Regional data boundary for an image. - * - * @param regionalDataBoundary Regional data boundary for an image. + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withRegionalDataBoundary(RegionalDataBoundary regionalDataBoundary); + WithCreate withProperties(ImageProperties properties); } } /** * Begins update for the Image resource. - * + * * @return the stage of resource update. */ Image.Update update(); - /** The template for Image update. */ + /** + * The template for Image update. + */ interface Update { /** * Executes the update request. - * + * * @return the updated resource. */ Image apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Image apply(Context context); } - /** The Image update stages. */ + /** + * The Image update stages. + */ interface UpdateStages { } /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Image refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageListResult.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageListResult.java index a6e018f8b2eec..a88e846764dcd 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageListResult.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageListResult.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a Image list operation. */ +/** + * The response of a Image list operation. + */ @Fluent public final class ImageListResult { /* @@ -22,16 +24,18 @@ public final class ImageListResult { /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of ImageListResult class. */ + /** + * Creates an instance of ImageListResult class. + */ public ImageListResult() { } /** * Get the value property: The Image items on this page. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The Image items on this page. - * + * * @param value the value value to set. * @return the ImageListResult object itself. */ @@ -51,34 +55,22 @@ public ImageListResult withValue(List value) { /** * Get the nextLink property: The link to the next page of items. - * + * * @return the nextLink value. */ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @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")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model ImageListResult")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ImageProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageProperties.java similarity index 91% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ImageProperties.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageProperties.java index 26464c8d0a60a..a2c63b632aa81 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ImageProperties.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageProperties.java @@ -2,15 +2,14 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.sphere.fluent.models; +package com.azure.resourcemanager.sphere.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.sphere.models.ImageType; -import com.azure.resourcemanager.sphere.models.ProvisioningState; -import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; import com.fasterxml.jackson.annotation.JsonProperty; -/** The properties of image. */ +/** + * The properties of image. + */ @Fluent public final class ImageProperties { /* @@ -67,14 +66,16 @@ public final class ImageProperties { @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; - /** Creates an instance of ImageProperties class. */ + /** + * Creates an instance of ImageProperties class. + */ public ImageProperties() { } /** * Get the image property: Image as a UTF-8 encoded base 64 string on image create. This field contains the image * URI on image reads. - * + * * @return the image value. */ public String image() { @@ -84,7 +85,7 @@ public String image() { /** * Set the image property: Image as a UTF-8 encoded base 64 string on image create. This field contains the image * URI on image reads. - * + * * @param image the image value to set. * @return the ImageProperties object itself. */ @@ -95,7 +96,7 @@ public ImageProperties withImage(String image) { /** * Get the imageId property: Image ID. - * + * * @return the imageId value. */ public String imageId() { @@ -104,7 +105,7 @@ public String imageId() { /** * Set the imageId property: Image ID. - * + * * @param imageId the imageId value to set. * @return the ImageProperties object itself. */ @@ -115,7 +116,7 @@ public ImageProperties withImageId(String imageId) { /** * Get the imageName property: Image name. - * + * * @return the imageName value. */ public String imageName() { @@ -124,7 +125,7 @@ public String imageName() { /** * Get the regionalDataBoundary property: Regional data boundary for an image. - * + * * @return the regionalDataBoundary value. */ public RegionalDataBoundary regionalDataBoundary() { @@ -133,7 +134,7 @@ public RegionalDataBoundary regionalDataBoundary() { /** * Set the regionalDataBoundary property: Regional data boundary for an image. - * + * * @param regionalDataBoundary the regionalDataBoundary value to set. * @return the ImageProperties object itself. */ @@ -144,7 +145,7 @@ public ImageProperties withRegionalDataBoundary(RegionalDataBoundary regionalDat /** * Get the uri property: Location the image. - * + * * @return the uri value. */ public String uri() { @@ -153,7 +154,7 @@ public String uri() { /** * Get the description property: The image description. - * + * * @return the description value. */ public String description() { @@ -162,7 +163,7 @@ public String description() { /** * Get the componentId property: The image component id. - * + * * @return the componentId value. */ public String componentId() { @@ -171,7 +172,7 @@ public String componentId() { /** * Get the imageType property: The image type. - * + * * @return the imageType value. */ public ImageType imageType() { @@ -180,7 +181,7 @@ public ImageType imageType() { /** * Get the provisioningState property: The status of the last operation. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -189,7 +190,7 @@ public ProvisioningState provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageType.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageType.java index b12f2162886a8..6d4989951a21e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageType.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ImageType.java @@ -8,83 +8,133 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Image type values. */ +/** + * Image type values. + */ public final class ImageType extends ExpandableStringEnum { - /** Static value InvalidImageType for ImageType. */ + /** + * Static value InvalidImageType for ImageType. + */ public static final ImageType INVALID_IMAGE_TYPE = fromString("InvalidImageType"); - /** Static value OneBl for ImageType. */ + /** + * Static value OneBl for ImageType. + */ public static final ImageType ONE_BL = fromString("OneBl"); - /** Static value PlutonRuntime for ImageType. */ + /** + * Static value PlutonRuntime for ImageType. + */ public static final ImageType PLUTON_RUNTIME = fromString("PlutonRuntime"); - /** Static value WifiFirmware for ImageType. */ + /** + * Static value WifiFirmware for ImageType. + */ public static final ImageType WIFI_FIRMWARE = fromString("WifiFirmware"); - /** Static value SecurityMonitor for ImageType. */ + /** + * Static value SecurityMonitor for ImageType. + */ public static final ImageType SECURITY_MONITOR = fromString("SecurityMonitor"); - /** Static value NormalWorldLoader for ImageType. */ + /** + * Static value NormalWorldLoader for ImageType. + */ public static final ImageType NORMAL_WORLD_LOADER = fromString("NormalWorldLoader"); - /** Static value NormalWorldDtb for ImageType. */ + /** + * Static value NormalWorldDtb for ImageType. + */ public static final ImageType NORMAL_WORLD_DTB = fromString("NormalWorldDtb"); - /** Static value NormalWorldKernel for ImageType. */ + /** + * Static value NormalWorldKernel for ImageType. + */ public static final ImageType NORMAL_WORLD_KERNEL = fromString("NormalWorldKernel"); - /** Static value RootFs for ImageType. */ + /** + * Static value RootFs for ImageType. + */ public static final ImageType ROOT_FS = fromString("RootFs"); - /** Static value Services for ImageType. */ + /** + * Static value Services for ImageType. + */ public static final ImageType SERVICES = fromString("Services"); - /** Static value Applications for ImageType. */ + /** + * Static value Applications for ImageType. + */ public static final ImageType APPLICATIONS = fromString("Applications"); - /** Static value FwConfig for ImageType. */ + /** + * Static value FwConfig for ImageType. + */ public static final ImageType FW_CONFIG = fromString("FwConfig"); - /** Static value BootManifest for ImageType. */ + /** + * Static value BootManifest for ImageType. + */ public static final ImageType BOOT_MANIFEST = fromString("BootManifest"); - /** Static value Nwfs for ImageType. */ + /** + * Static value Nwfs for ImageType. + */ public static final ImageType NWFS = fromString("Nwfs"); - /** Static value TrustedKeystore for ImageType. */ + /** + * Static value TrustedKeystore for ImageType. + */ public static final ImageType TRUSTED_KEYSTORE = fromString("TrustedKeystore"); - /** Static value Policy for ImageType. */ + /** + * Static value Policy for ImageType. + */ public static final ImageType POLICY = fromString("Policy"); - /** Static value CustomerBoardConfig for ImageType. */ + /** + * Static value CustomerBoardConfig for ImageType. + */ public static final ImageType CUSTOMER_BOARD_CONFIG = fromString("CustomerBoardConfig"); - /** Static value UpdateCertStore for ImageType. */ + /** + * Static value UpdateCertStore for ImageType. + */ public static final ImageType UPDATE_CERT_STORE = fromString("UpdateCertStore"); - /** Static value BaseSystemUpdateManifest for ImageType. */ + /** + * Static value BaseSystemUpdateManifest for ImageType. + */ public static final ImageType BASE_SYSTEM_UPDATE_MANIFEST = fromString("BaseSystemUpdateManifest"); - /** Static value FirmwareUpdateManifest for ImageType. */ + /** + * Static value FirmwareUpdateManifest for ImageType. + */ public static final ImageType FIRMWARE_UPDATE_MANIFEST = fromString("FirmwareUpdateManifest"); - /** Static value CustomerUpdateManifest for ImageType. */ + /** + * Static value CustomerUpdateManifest for ImageType. + */ public static final ImageType CUSTOMER_UPDATE_MANIFEST = fromString("CustomerUpdateManifest"); - /** Static value RecoveryManifest for ImageType. */ + /** + * Static value RecoveryManifest for ImageType. + */ public static final ImageType RECOVERY_MANIFEST = fromString("RecoveryManifest"); - /** Static value ManifestSet for ImageType. */ + /** + * Static value ManifestSet for ImageType. + */ public static final ImageType MANIFEST_SET = fromString("ManifestSet"); - /** Static value Other for ImageType. */ + /** + * Static value Other for ImageType. + */ public static final ImageType OTHER = fromString("Other"); /** * Creates a new instance of ImageType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -93,7 +143,7 @@ public ImageType() { /** * Creates or finds a ImageType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ImageType. */ @@ -104,7 +154,7 @@ public static ImageType fromString(String name) { /** * Gets known ImageType values. - * + * * @return known ImageType values. */ public static Collection values() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Images.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Images.java index 482e9daa70998..da17aaf6899ac 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Images.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Images.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Images. */ +/** + * Resource collection API of Images. + */ public interface Images { /** * List Image resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +26,7 @@ public interface Images { /** * List Image resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param filter Filter the result list using the given expression. @@ -37,21 +39,15 @@ public interface Images { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a Image list operation as paginated response with {@link PagedIterable}. */ - PagedIterable listByCatalog( - String resourceGroupName, - String catalogName, - String filter, - Integer top, - Integer skip, - Integer maxpagesize, - Context context); + PagedIterable listByCatalog(String resourceGroupName, String catalogName, String filter, Integer top, + Integer skip, Integer maxpagesize, Context context); /** * Get a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -62,10 +58,10 @@ PagedIterable listByCatalog( /** * Get a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -75,10 +71,10 @@ PagedIterable listByCatalog( /** * Delete a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -87,10 +83,10 @@ PagedIterable listByCatalog( /** * Delete a Image. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use an image GUID for GA versions of the 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. @@ -100,7 +96,7 @@ PagedIterable listByCatalog( /** * Get a Image. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -111,7 +107,7 @@ PagedIterable listByCatalog( /** * Get a Image. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -123,7 +119,7 @@ PagedIterable listByCatalog( /** * Delete a Image. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -133,7 +129,7 @@ PagedIterable listByCatalog( /** * Delete a Image. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -144,7 +140,7 @@ PagedIterable listByCatalog( /** * Begins definition for a new Image resource. - * + * * @param name resource name. * @return the first stage of the new Image definition. */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ListDeviceGroupsRequest.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ListDeviceGroupsRequest.java index aeac84fe7a660..577a0d17c6feb 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ListDeviceGroupsRequest.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ListDeviceGroupsRequest.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** Request of the action to list device groups for a catalog. */ +/** + * Request of the action to list device groups for a catalog. + */ @Fluent public final class ListDeviceGroupsRequest { /* @@ -16,13 +18,15 @@ public final class ListDeviceGroupsRequest { @JsonProperty(value = "deviceGroupName") private String deviceGroupName; - /** Creates an instance of ListDeviceGroupsRequest class. */ + /** + * Creates an instance of ListDeviceGroupsRequest class. + */ public ListDeviceGroupsRequest() { } /** * Get the deviceGroupName property: Device Group name. - * + * * @return the deviceGroupName value. */ public String deviceGroupName() { @@ -31,7 +35,7 @@ public String deviceGroupName() { /** * Set the deviceGroupName property: Device Group name. - * + * * @param deviceGroupName the deviceGroupName value to set. * @return the ListDeviceGroupsRequest object itself. */ @@ -42,7 +46,7 @@ public ListDeviceGroupsRequest withDeviceGroupName(String deviceGroupName) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OSFeedType.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OSFeedType.java index b22ba3545e505..df86906705bf7 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OSFeedType.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OSFeedType.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** OS feed type values. */ +/** + * OS feed type values. + */ public final class OSFeedType extends ExpandableStringEnum { - /** Static value Retail for OSFeedType. */ + /** + * Static value Retail for OSFeedType. + */ public static final OSFeedType RETAIL = fromString("Retail"); - /** Static value RetailEval for OSFeedType. */ + /** + * Static value RetailEval for OSFeedType. + */ public static final OSFeedType RETAIL_EVAL = fromString("RetailEval"); /** * Creates a new instance of OSFeedType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public OSFeedType() { /** * Creates or finds a OSFeedType from its string representation. - * + * * @param name a name to look for. * @return the corresponding OSFeedType. */ @@ -38,7 +44,7 @@ public static OSFeedType fromString(String name) { /** * Gets known OSFeedType values. - * + * * @return known OSFeedType values. */ public static Collection values() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Operation.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Operation.java index 7fd48e4bde394..f39a2845910dc 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Operation.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Operation.java @@ -6,12 +6,14 @@ import com.azure.resourcemanager.sphere.fluent.models.OperationInner; -/** An immutable client-side representation of Operation. */ +/** + * An immutable client-side representation of Operation. + */ public interface Operation { /** * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * + * * @return the name value. */ String name(); @@ -19,14 +21,14 @@ public interface Operation { /** * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane * operations and "false" for ARM/control-plane operations. - * + * * @return the isDataAction value. */ Boolean isDataAction(); /** * Gets the display property: Localized display information for this particular operation. - * + * * @return the display value. */ OperationDisplay display(); @@ -34,7 +36,7 @@ public interface Operation { /** * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and * audit logs UX. Default value is "user,system". - * + * * @return the origin value. */ Origin origin(); @@ -42,14 +44,14 @@ public interface Operation { /** * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal * only APIs. - * + * * @return the actionType value. */ ActionType actionType(); /** * Gets the inner com.azure.resourcemanager.sphere.fluent.models.OperationInner object. - * + * * @return the inner object. */ OperationInner innerModel(); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OperationDisplay.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OperationDisplay.java index 562d7f5f396c8..176049cf9e0d7 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OperationDisplay.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OperationDisplay.java @@ -7,7 +7,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Localized display information for this particular operation. */ +/** + * Localized display information for this particular operation. + */ @Immutable public final class OperationDisplay { /* @@ -37,14 +39,16 @@ public final class OperationDisplay { @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; - /** Creates an instance of OperationDisplay class. */ + /** + * Creates an instance of OperationDisplay class. + */ public OperationDisplay() { } /** * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring * Insights" or "Microsoft Compute". - * + * * @return the provider value. */ public String provider() { @@ -54,7 +58,7 @@ public String provider() { /** * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. * "Virtual Machines" or "Job Schedule Collections". - * + * * @return the resource value. */ public String resource() { @@ -64,7 +68,7 @@ public String resource() { /** * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. * "Create or Update Virtual Machine", "Restart Virtual Machine". - * + * * @return the operation value. */ public String operation() { @@ -74,7 +78,7 @@ public String operation() { /** * Get the description property: The short, localized friendly description of the operation; suitable for tool tips * and detailed views. - * + * * @return the description value. */ public String description() { @@ -83,7 +87,7 @@ public String description() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OperationListResult.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OperationListResult.java index e9291b9358f4f..01821c5564be6 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OperationListResult.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/OperationListResult.java @@ -10,8 +10,8 @@ import java.util.List; /** - * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of - * results. + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set + * of results. */ @Immutable public final class OperationListResult { @@ -27,13 +27,15 @@ public final class OperationListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of OperationListResult class. */ + /** + * Creates an instance of OperationListResult class. + */ public OperationListResult() { } /** * Get the value property: List of operations supported by the resource provider. - * + * * @return the value value. */ public List value() { @@ -42,7 +44,7 @@ public List 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() { @@ -51,7 +53,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Operations.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Operations.java index 53ce30f3ca799..fad6812e8ca83 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Operations.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Operations.java @@ -7,27 +7,29 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of Operations. */ +/** + * Resource collection API of Operations. + */ public interface Operations { /** * List the operations for the 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** * List the operations for the 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Origin.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Origin.java index a5871fb788c75..7b023584191ff 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Origin.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Origin.java @@ -13,18 +13,24 @@ * is "user,system". */ public final class Origin extends ExpandableStringEnum { - /** Static value user for Origin. */ + /** + * Static value user for Origin. + */ public static final Origin USER = fromString("user"); - /** Static value system for Origin. */ + /** + * Static value system for Origin. + */ public static final Origin SYSTEM = fromString("system"); - /** Static value user,system for Origin. */ + /** + * Static value user,system for Origin. + */ public static final Origin USER_SYSTEM = fromString("user,system"); /** * Creates a new instance of Origin value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,7 +39,7 @@ public Origin() { /** * Creates or finds a Origin from its string representation. - * + * * @param name a name to look for. * @return the corresponding Origin. */ @@ -44,7 +50,7 @@ public static Origin fromString(String name) { /** * Gets known Origin values. - * + * * @return known Origin values. */ public static Collection values() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/PagedDeviceInsight.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/PagedDeviceInsight.java index 36810c2a7ab54..518bec40d5447 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/PagedDeviceInsight.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/PagedDeviceInsight.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** Paged collection of DeviceInsight items. */ +/** + * Paged collection of DeviceInsight items. + */ @Fluent public final class PagedDeviceInsight { /* @@ -22,16 +24,18 @@ public final class PagedDeviceInsight { /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of PagedDeviceInsight class. */ + /** + * Creates an instance of PagedDeviceInsight class. + */ public PagedDeviceInsight() { } /** * Get the value property: The DeviceInsight items on this page. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The DeviceInsight items on this page. - * + * * @param value the value value to set. * @return the PagedDeviceInsight object itself. */ @@ -51,34 +55,22 @@ public PagedDeviceInsight withValue(List value) { /** * Get the nextLink property: The link to the next page of items. - * + * * @return the nextLink value. */ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the PagedDeviceInsight object itself. - */ - public PagedDeviceInsight 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 PagedDeviceInsight")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model PagedDeviceInsight")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Product.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Product.java index d88525e092fc0..e57616eacea67 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Product.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Product.java @@ -6,76 +6,87 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.sphere.fluent.models.ProductInner; -/** An immutable client-side representation of Product. */ +/** + * An immutable client-side representation of Product. + */ public interface Product { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** - * Gets the description property: Description of the product. - * - * @return the description value. + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - String description(); + ProductProperties properties(); /** - * Gets the provisioningState property: The status of the last operation. - * - * @return the provisioningState value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - ProvisioningState provisioningState(); + SystemData systemData(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.sphere.fluent.models.ProductInner object. - * + * * @return the inner object. */ ProductInner innerModel(); - /** The entirety of the Product definition. */ + /** + * The entirety of the Product definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } - /** The Product definition stages. */ + /** + * The Product definition stages. + */ interface DefinitionStages { - /** The first stage of the Product definition. */ + /** + * The first stage of the Product definition. + */ interface Blank extends WithParentResource { } - /** The stage of the Product definition allowing to specify parent resource. */ + /** + * The stage of the Product definition allowing to specify parent resource. + */ interface WithParentResource { /** * Specifies resourceGroupName, catalogName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @return the next definition stage. @@ -87,84 +98,92 @@ interface WithParentResource { * The stage of the Product 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 DefinitionStages.WithDescription { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. - * + * * @return the created resource. */ Product create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Product create(Context context); } - /** The stage of the Product definition allowing to specify description. */ - interface WithDescription { + /** + * The stage of the Product definition allowing to specify properties. + */ + interface WithProperties { /** - * Specifies the description property: Description of the product. - * - * @param description Description of the product. + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withDescription(String description); + WithCreate withProperties(ProductProperties properties); } } /** * Begins update for the Product resource. - * + * * @return the stage of resource update. */ Product.Update update(); - /** The template for Product update. */ - interface Update extends UpdateStages.WithDescription { + /** + * The template for Product update. + */ + interface Update extends UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ Product apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Product apply(Context context); } - /** The Product update stages. */ + /** + * The Product update stages. + */ interface UpdateStages { - /** The stage of the Product update allowing to specify description. */ - interface WithDescription { + /** + * The stage of the Product update allowing to specify properties. + */ + interface WithProperties { /** - * Specifies the description property: Description of the product. - * - * @param description Description of the product. + * Specifies the properties property: The updatable properties of the Product.. + * + * @param properties The updatable properties of the Product. * @return the next definition stage. */ - Update withDescription(String description); + Update withProperties(ProductUpdateProperties properties); } } /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Product refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ @@ -173,29 +192,29 @@ interface WithDescription { /** * Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product * 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 to the action call for count devices in a catalog along with {@link Response}. */ - Response countDevicesWithResponse(Context context); + Response countDevicesWithResponse(Context context); /** * Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product * name. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response to the action call for count devices in a catalog. */ - CountDeviceResponse countDevices(); + CountDevicesResponse countDevices(); /** * Generates default device groups for the product. '.default' and '.unassigned' are system defined values and * cannot be used for product name. - * + * * @throws com.azure.core.management.exception.ManagementException thrown 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 a DeviceGroup list operation as paginated response with {@link PagedIterable}. @@ -205,7 +224,7 @@ interface WithDescription { /** * Generates default device groups for the product. '.default' and '.unassigned' are system defined values and * cannot be used for product 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. diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductListResult.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductListResult.java index 37e441bd57a68..1008e53514ebe 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductListResult.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductListResult.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a Product list operation. */ +/** + * The response of a Product list operation. + */ @Fluent public final class ProductListResult { /* @@ -22,16 +24,18 @@ public final class ProductListResult { /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of ProductListResult class. */ + /** + * Creates an instance of ProductListResult class. + */ public ProductListResult() { } /** * Get the value property: The Product items on this page. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The Product items on this page. - * + * * @param value the value value to set. * @return the ProductListResult object itself. */ @@ -51,34 +55,22 @@ public ProductListResult withValue(List value) { /** * Get the nextLink property: The link to the next page of items. - * + * * @return the nextLink value. */ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to the next page of items. - * - * @param nextLink the nextLink value to set. - * @return the ProductListResult object itself. - */ - public ProductListResult 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 ProductListResult")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model ProductListResult")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProductProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductProperties.java similarity index 69% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProductProperties.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductProperties.java index c9e8cd2176f70..477c971fdda9e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProductProperties.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductProperties.java @@ -2,20 +2,20 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.sphere.fluent.models; +package com.azure.resourcemanager.sphere.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.sphere.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; -/** The properties of product. */ +/** + * The properties of product. + */ @Fluent public final class ProductProperties { /* * Description of the product */ - @JsonProperty(value = "description", required = true) + @JsonProperty(value = "description") private String description; /* @@ -24,13 +24,15 @@ public final class ProductProperties { @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; - /** Creates an instance of ProductProperties class. */ + /** + * Creates an instance of ProductProperties class. + */ public ProductProperties() { } /** * Get the description property: Description of the product. - * + * * @return the description value. */ public String description() { @@ -39,7 +41,7 @@ public String description() { /** * Set the description property: Description of the product. - * + * * @param description the description value to set. * @return the ProductProperties object itself. */ @@ -50,7 +52,7 @@ public ProductProperties withDescription(String description) { /** * Get the provisioningState property: The status of the last operation. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -59,16 +61,9 @@ public ProvisioningState provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (description() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property description in model ProductProperties")); - } } - - private static final ClientLogger LOGGER = new ClientLogger(ProductProperties.class); } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductUpdate.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductUpdate.java index 728b43305eb4a..344d810850829 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductUpdate.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductUpdate.java @@ -5,62 +5,53 @@ package com.azure.resourcemanager.sphere.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.sphere.fluent.models.ProductUpdateProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** The type used for update operations of the Product. */ +/** + * The type used for update operations of the Product. + */ @Fluent public final class ProductUpdate { /* * The updatable properties of the Product. */ @JsonProperty(value = "properties") - private ProductUpdateProperties innerProperties; - - /** Creates an instance of ProductUpdate class. */ - public ProductUpdate() { - } + private ProductUpdateProperties properties; /** - * Get the innerProperties property: The updatable properties of the Product. - * - * @return the innerProperties value. + * Creates an instance of ProductUpdate class. */ - private ProductUpdateProperties innerProperties() { - return this.innerProperties; + public ProductUpdate() { } /** - * Get the description property: Description of the product. - * - * @return the description value. + * Get the properties property: The updatable properties of the Product. + * + * @return the properties value. */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); + public ProductUpdateProperties properties() { + return this.properties; } /** - * Set the description property: Description of the product. - * - * @param description the description value to set. + * Set the properties property: The updatable properties of the Product. + * + * @param properties the properties value to set. * @return the ProductUpdate object itself. */ - public ProductUpdate withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new ProductUpdateProperties(); - } - this.innerProperties().withDescription(description); + public ProductUpdate withProperties(ProductUpdateProperties properties) { + this.properties = properties; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProductUpdateProperties.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductUpdateProperties.java similarity index 85% rename from sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProductUpdateProperties.java rename to sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductUpdateProperties.java index 77e75f019861f..fd4cc19da2ffe 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/fluent/models/ProductUpdateProperties.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProductUpdateProperties.java @@ -2,12 +2,14 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.sphere.fluent.models; +package com.azure.resourcemanager.sphere.models; import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; -/** The updatable properties of the Product. */ +/** + * The updatable properties of the Product. + */ @Fluent public final class ProductUpdateProperties { /* @@ -16,13 +18,15 @@ public final class ProductUpdateProperties { @JsonProperty(value = "description") private String description; - /** Creates an instance of ProductUpdateProperties class. */ + /** + * Creates an instance of ProductUpdateProperties class. + */ public ProductUpdateProperties() { } /** * Get the description property: Description of the product. - * + * * @return the description value. */ public String description() { @@ -31,7 +35,7 @@ public String description() { /** * Set the description property: Description of the product. - * + * * @param description the description value to set. * @return the ProductUpdateProperties object itself. */ @@ -42,7 +46,7 @@ public ProductUpdateProperties withDescription(String description) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Products.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Products.java index 2d19d86941ed4..c6ebe0df8eafa 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Products.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/Products.java @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Products. */ +/** + * Resource collection API of Products. + */ public interface Products { /** * List Product resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -24,7 +26,7 @@ public interface Products { /** * List Product resources by Catalog. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param context The context to associate with this operation. @@ -37,7 +39,7 @@ public interface Products { /** * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -47,12 +49,12 @@ public interface Products { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Product along with {@link Response}. */ - Response getWithResponse( - String resourceGroupName, String catalogName, String productName, Context context); + Response getWithResponse(String resourceGroupName, String catalogName, String productName, + Context context); /** * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -65,7 +67,7 @@ Response getWithResponse( /** * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -77,7 +79,7 @@ Response getWithResponse( /** * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -91,7 +93,7 @@ Response getWithResponse( /** * Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product * name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -101,13 +103,13 @@ Response getWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response to the action call for count devices in a catalog along with {@link Response}. */ - Response countDevicesWithResponse( - String resourceGroupName, String catalogName, String productName, Context context); + Response countDevicesWithResponse(String resourceGroupName, String catalogName, + String productName, Context context); /** * Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product * name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -116,12 +118,12 @@ Response countDevicesWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return response to the action call for count devices in a catalog. */ - CountDeviceResponse countDevices(String resourceGroupName, String catalogName, String productName); + CountDevicesResponse countDevices(String resourceGroupName, String catalogName, String productName); /** * Generates default device groups for the product. '.default' and '.unassigned' are system defined values and * cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -130,13 +132,13 @@ Response countDevicesWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. */ - PagedIterable generateDefaultDeviceGroups( - String resourceGroupName, String catalogName, String productName); + PagedIterable generateDefaultDeviceGroups(String resourceGroupName, String catalogName, + String productName); /** * Generates default device groups for the product. '.default' and '.unassigned' are system defined values and * cannot be used for product name. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog. * @param productName Name of product. @@ -146,12 +148,12 @@ PagedIterable generateDefaultDeviceGroups( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a DeviceGroup list operation as paginated response with {@link PagedIterable}. */ - PagedIterable generateDefaultDeviceGroups( - String resourceGroupName, String catalogName, String productName, Context context); + PagedIterable generateDefaultDeviceGroups(String resourceGroupName, String catalogName, + String productName, Context context); /** * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -162,7 +164,7 @@ PagedIterable generateDefaultDeviceGroups( /** * Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -174,7 +176,7 @@ PagedIterable generateDefaultDeviceGroups( /** * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -184,7 +186,7 @@ PagedIterable generateDefaultDeviceGroups( /** * Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name'. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -195,7 +197,7 @@ PagedIterable generateDefaultDeviceGroups( /** * Begins definition for a new Product resource. - * + * * @param name resource name. * @return the first stage of the new Product definition. */ diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProofOfPossessionNonceRequest.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProofOfPossessionNonceRequest.java index 259f942574dae..04c79b6216470 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProofOfPossessionNonceRequest.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProofOfPossessionNonceRequest.java @@ -8,7 +8,9 @@ import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; -/** Request for the proof of possession nonce. */ +/** + * Request for the proof of possession nonce. + */ @Fluent public final class ProofOfPossessionNonceRequest { /* @@ -17,13 +19,15 @@ public final class ProofOfPossessionNonceRequest { @JsonProperty(value = "proofOfPossessionNonce", required = true) private String proofOfPossessionNonce; - /** Creates an instance of ProofOfPossessionNonceRequest class. */ + /** + * Creates an instance of ProofOfPossessionNonceRequest class. + */ public ProofOfPossessionNonceRequest() { } /** * Get the proofOfPossessionNonce property: The proof of possession nonce. - * + * * @return the proofOfPossessionNonce value. */ public String proofOfPossessionNonce() { @@ -32,7 +36,7 @@ public String proofOfPossessionNonce() { /** * Set the proofOfPossessionNonce property: The proof of possession nonce. - * + * * @param proofOfPossessionNonce the proofOfPossessionNonce value to set. * @return the ProofOfPossessionNonceRequest object itself. */ @@ -43,15 +47,13 @@ public ProofOfPossessionNonceRequest withProofOfPossessionNonce(String proofOfPo /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (proofOfPossessionNonce() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property proofOfPossessionNonce in model ProofOfPossessionNonceRequest")); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + "Missing required property proofOfPossessionNonce in model ProofOfPossessionNonceRequest")); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProofOfPossessionNonceResponse.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProofOfPossessionNonceResponse.java index 74245243ac808..3bcdf8d2100d1 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProofOfPossessionNonceResponse.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProofOfPossessionNonceResponse.java @@ -7,60 +7,62 @@ import com.azure.resourcemanager.sphere.fluent.models.ProofOfPossessionNonceResponseInner; import java.time.OffsetDateTime; -/** An immutable client-side representation of ProofOfPossessionNonceResponse. */ +/** + * An immutable client-side representation of ProofOfPossessionNonceResponse. + */ public interface ProofOfPossessionNonceResponse { /** * Gets the certificate property: The certificate as a UTF-8 encoded base 64 string. - * + * * @return the certificate value. */ String certificate(); /** * Gets the status property: The certificate status. - * + * * @return the status value. */ CertificateStatus status(); /** * Gets the subject property: The certificate subject. - * + * * @return the subject value. */ String subject(); /** * Gets the thumbprint property: The certificate thumbprint. - * + * * @return the thumbprint value. */ String thumbprint(); /** * Gets the expiryUtc property: The certificate expiry date. - * + * * @return the expiryUtc value. */ OffsetDateTime expiryUtc(); /** * Gets the notBeforeUtc property: The certificate not before date. - * + * * @return the notBeforeUtc value. */ OffsetDateTime notBeforeUtc(); /** * Gets the provisioningState property: The status of the last operation. - * + * * @return the provisioningState value. */ ProvisioningState provisioningState(); /** * Gets the inner com.azure.resourcemanager.sphere.fluent.models.ProofOfPossessionNonceResponseInner object. - * + * * @return the inner object. */ ProofOfPossessionNonceResponseInner innerModel(); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProvisioningState.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProvisioningState.java index 2b6e552a5b3e4..83fe4afb8936e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProvisioningState.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/ProvisioningState.java @@ -8,32 +8,48 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Provisioning state of the resource. */ +/** + * Provisioning state of resource. + */ public final class ProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for ProvisioningState. */ + /** + * Static value Succeeded for ProvisioningState. + */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for ProvisioningState. */ + /** + * Static value Failed for ProvisioningState. + */ public static final ProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for ProvisioningState. */ + /** + * Static value Canceled for ProvisioningState. + */ public static final ProvisioningState CANCELED = fromString("Canceled"); - /** Static value Provisioning for ProvisioningState. */ + /** + * Static value Provisioning for ProvisioningState. + */ public static final ProvisioningState PROVISIONING = fromString("Provisioning"); - /** Static value Updating for ProvisioningState. */ + /** + * Static value Updating for ProvisioningState. + */ public static final ProvisioningState UPDATING = fromString("Updating"); - /** Static value Deleting for ProvisioningState. */ + /** + * Static value Deleting for ProvisioningState. + */ public static final ProvisioningState DELETING = fromString("Deleting"); - /** Static value Accepted for ProvisioningState. */ + /** + * Static value Accepted for ProvisioningState. + */ public static final ProvisioningState ACCEPTED = fromString("Accepted"); /** * Creates a new instance of ProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -42,7 +58,7 @@ public ProvisioningState() { /** * Creates or finds a ProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding ProvisioningState. */ @@ -53,7 +69,7 @@ public static ProvisioningState fromString(String name) { /** * Gets known ProvisioningState values. - * + * * @return known ProvisioningState values. */ public static Collection values() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/RegionalDataBoundary.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/RegionalDataBoundary.java index 37ff9a000820c..d91169299d5fc 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/RegionalDataBoundary.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/RegionalDataBoundary.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Regional data boundary values. */ +/** + * Regional data boundary values. + */ public final class RegionalDataBoundary extends ExpandableStringEnum { - /** Static value None for RegionalDataBoundary. */ + /** + * Static value None for RegionalDataBoundary. + */ public static final RegionalDataBoundary NONE = fromString("None"); - /** Static value EU for RegionalDataBoundary. */ + /** + * Static value EU for RegionalDataBoundary. + */ public static final RegionalDataBoundary EU = fromString("EU"); /** * Creates a new instance of RegionalDataBoundary value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public RegionalDataBoundary() { /** * Creates or finds a RegionalDataBoundary from its string representation. - * + * * @param name a name to look for. * @return the corresponding RegionalDataBoundary. */ @@ -38,7 +44,7 @@ public static RegionalDataBoundary fromString(String name) { /** * Gets known RegionalDataBoundary values. - * + * * @return known RegionalDataBoundary values. */ public static Collection values() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/SignedCapabilityImageResponse.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/SignedCapabilityImageResponse.java index 3e93a7ae3156b..d2477da612aeb 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/SignedCapabilityImageResponse.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/SignedCapabilityImageResponse.java @@ -6,18 +6,20 @@ import com.azure.resourcemanager.sphere.fluent.models.SignedCapabilityImageResponseInner; -/** An immutable client-side representation of SignedCapabilityImageResponse. */ +/** + * An immutable client-side representation of SignedCapabilityImageResponse. + */ public interface SignedCapabilityImageResponse { /** * Gets the image property: The signed device capability image as a UTF-8 encoded base 64 string. - * + * * @return the image value. */ String image(); /** * Gets the inner com.azure.resourcemanager.sphere.fluent.models.SignedCapabilityImageResponseInner object. - * + * * @return the inner object. */ SignedCapabilityImageResponseInner innerModel(); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/UpdatePolicy.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/UpdatePolicy.java index 3153c79aed9a0..dfcee7e165628 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/UpdatePolicy.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/UpdatePolicy.java @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Update policy values. */ +/** + * Update policy values. + */ public final class UpdatePolicy extends ExpandableStringEnum { - /** Static value UpdateAll for UpdatePolicy. */ + /** + * Static value UpdateAll for UpdatePolicy. + */ public static final UpdatePolicy UPDATE_ALL = fromString("UpdateAll"); - /** Static value No3rdPartyAppUpdates for UpdatePolicy. */ + /** + * Static value No3rdPartyAppUpdates for UpdatePolicy. + */ public static final UpdatePolicy NO3RD_PARTY_APP_UPDATES = fromString("No3rdPartyAppUpdates"); /** * Creates a new instance of UpdatePolicy value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public UpdatePolicy() { /** * Creates or finds a UpdatePolicy from its string representation. - * + * * @param name a name to look for. * @return the corresponding UpdatePolicy. */ @@ -38,7 +44,7 @@ public static UpdatePolicy fromString(String name) { /** * Gets known UpdatePolicy values. - * + * * @return known UpdatePolicy values. */ public static Collection values() { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/package-info.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/package-info.java index 1434cd8dbacf7..5ee8c5416a246 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/package-info.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the data models for AzureSphereManagementClient. Azure Sphere resource management API. */ +/** + * Package containing the data models for AzureSphereMgmtClient. + * Azure Sphere resource management API. + */ package com.azure.resourcemanager.sphere.models; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/package-info.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/package-info.java index 0b51b3be880aa..229d09be942a6 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/package-info.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/com/azure/resourcemanager/sphere/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the classes for AzureSphereManagementClient. Azure Sphere resource management API. */ +/** + * Package containing the classes for AzureSphereMgmtClient. + * Azure Sphere resource management API. + */ package com.azure.resourcemanager.sphere; diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/module-info.java b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/module-info.java index bd2ed817d1ea2..e7b19257c6ccd 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/main/java/module-info.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/java/module-info.java @@ -4,16 +4,10 @@ module com.azure.resourcemanager.sphere { requires transitive com.azure.core.management; - exports com.azure.resourcemanager.sphere; exports com.azure.resourcemanager.sphere.fluent; exports com.azure.resourcemanager.sphere.fluent.models; exports com.azure.resourcemanager.sphere.models; - - opens com.azure.resourcemanager.sphere.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.sphere.models to - com.azure.core, - com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.sphere.fluent.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.sphere.models to com.azure.core, com.fasterxml.jackson.databind; } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-sphere/proxy-config.json b/sdk/sphere/azure-resourcemanager-sphere/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-sphere/proxy-config.json new file mode 100644 index 0000000000000..059551aba04b7 --- /dev/null +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-sphere/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.sphere.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.sphere.implementation.CatalogsClientImpl$CatalogsService" ], [ "com.azure.resourcemanager.sphere.implementation.CertificatesClientImpl$CertificatesService" ], [ "com.azure.resourcemanager.sphere.implementation.ImagesClientImpl$ImagesService" ], [ "com.azure.resourcemanager.sphere.implementation.ProductsClientImpl$ProductsService" ], [ "com.azure.resourcemanager.sphere.implementation.DeviceGroupsClientImpl$DeviceGroupsService" ], [ "com.azure.resourcemanager.sphere.implementation.DeploymentsClientImpl$DeploymentsService" ], [ "com.azure.resourcemanager.sphere.implementation.DevicesClientImpl$DevicesService" ] ] \ No newline at end of file diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-sphere/reflect-config.json b/sdk/sphere/azure-resourcemanager-sphere/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-sphere/reflect-config.json new file mode 100644 index 0000000000000..9bba8e24f5a1f --- /dev/null +++ b/sdk/sphere/azure-resourcemanager-sphere/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-sphere/reflect-config.json @@ -0,0 +1,266 @@ +[ { + "name" : "com.azure.resourcemanager.sphere.models.OperationListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.fluent.models.OperationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.OperationDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.CatalogListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.fluent.models.CatalogInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.CatalogProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.CatalogUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.CertificateListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.fluent.models.CertificateInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.CertificateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.fluent.models.CertificateChainResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.ProofOfPossessionNonceRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.fluent.models.ProofOfPossessionNonceResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.fluent.models.CountDevicesResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.CountElementsResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.ImageListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.fluent.models.ImageInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.ImageProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.DeploymentListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.fluent.models.DeploymentInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.DeploymentProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.ListDeviceGroupsRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.DeviceGroupListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.DeviceGroupProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.PagedDeviceInsight", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.fluent.models.DeviceInsightInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.DeviceListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.fluent.models.DeviceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.DeviceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.ProductListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.fluent.models.ProductInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.ProductProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.ProductUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.ProductUpdateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.DeviceGroupUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.DeviceGroupUpdateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.ClaimDevicesRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.DeviceUpdate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.DeviceUpdateProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.GenerateCapabilityImageRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.fluent.models.SignedCapabilityImageResponseInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.CountDeviceResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.Origin", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.ActionType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.ProvisioningState", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.CertificateStatus", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.RegionalDataBoundary", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.ImageType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.OSFeedType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.UpdatePolicy", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.sphere.models.CapabilityType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsCountDevicesSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsCountDevicesSamples.java index a953f4a717844..564480312993f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsCountDevicesSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsCountDevicesSamples.java @@ -4,14 +4,18 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Catalogs CountDevices. */ +/** + * Samples for Catalogs CountDevices. + */ public final class CatalogsCountDevicesSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesCatalog.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostCountDevicesCatalog. + * json */ /** * Sample code: Catalogs_CountDevices. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsCountDevices(com.azure.resourcemanager.sphere.AzureSphereManager manager) { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsCreateOrUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsCreateOrUpdateSamples.java index 66a5ddf183d95..5a3cc146ac6e0 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsCreateOrUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsCreateOrUpdateSamples.java @@ -4,22 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Catalogs CreateOrUpdate. */ +/** + * Samples for Catalogs CreateOrUpdate. + */ public final class CatalogsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutCatalog.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutCatalog.json */ /** * Sample code: Catalogs_CreateOrUpdate. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsCreateOrUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .catalogs() - .define("MyCatalog1") - .withRegion("global") - .withExistingResourceGroup("MyResourceGroup1") + manager.catalogs().define("MyCatalog1").withRegion("global").withExistingResourceGroup("MyResourceGroup1") .create(); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsDeleteSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsDeleteSamples.java index 4fbc13d2ade57..c5433706b759e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsDeleteSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsDeleteSamples.java @@ -4,14 +4,17 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Catalogs Delete. */ +/** + * Samples for Catalogs Delete. + */ public final class CatalogsDeleteSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteCatalog.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteCatalog.json */ /** * Sample code: Catalogs_Delete. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsDelete(com.azure.resourcemanager.sphere.AzureSphereManager manager) { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsGetByResourceGroupSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsGetByResourceGroupSamples.java index 009565ecd4de5..0420cbde35826 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsGetByResourceGroupSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsGetByResourceGroupSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Catalogs GetByResourceGroup. */ +/** + * Samples for Catalogs GetByResourceGroup. + */ public final class CatalogsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalog.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCatalog.json */ /** * Sample code: Catalogs_Get. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsGet(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .catalogs() - .getByResourceGroupWithResponse("MyResourceGroup1", "MyCatalog1", com.azure.core.util.Context.NONE); + manager.catalogs().getByResourceGroupWithResponse("MyResourceGroup1", "MyCatalog1", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListByResourceGroupSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListByResourceGroupSamples.java index 9a546c715b609..da2880834e187 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListByResourceGroupSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListByResourceGroupSamples.java @@ -4,14 +4,17 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Catalogs ListByResourceGroup. */ +/** + * Samples for Catalogs ListByResourceGroup. + */ public final class CatalogsListByResourceGroupSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalogsRG.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCatalogsRG.json */ /** * Sample code: Catalogs_ListByResourceGroup. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsListByResourceGroup(com.azure.resourcemanager.sphere.AzureSphereManager manager) { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeploymentsSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeploymentsSamples.java index bffa0c8b515d4..7acbb393e10d4 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeploymentsSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeploymentsSamples.java @@ -4,20 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Catalogs ListDeployments. */ +/** + * Samples for Catalogs ListDeployments. + */ public final class CatalogsListDeploymentsSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeploymentsByCatalog.json + * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ + * PostListDeploymentsByCatalog.json */ /** * Sample code: Catalogs_ListDeployments. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsListDeployments(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .catalogs() - .listDeployments( - "MyResourceGroup1", "MyCatalog1", null, null, null, null, com.azure.core.util.Context.NONE); + manager.catalogs().listDeployments("MyResourceGroup1", "MyCatalog1", null, null, null, null, + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceGroupsSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceGroupsSamples.java index 3876b11b2765c..f15657f10a594 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceGroupsSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceGroupsSamples.java @@ -6,27 +6,22 @@ import com.azure.resourcemanager.sphere.models.ListDeviceGroupsRequest; -/** Samples for Catalogs ListDeviceGroups. */ +/** + * Samples for Catalogs ListDeviceGroups. + */ public final class CatalogsListDeviceGroupsSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeviceGroupsCatalog.json + * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ + * PostListDeviceGroupsCatalog.json */ /** * Sample code: Catalogs_ListDeviceGroups. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsListDeviceGroups(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .catalogs() - .listDeviceGroups( - "MyResourceGroup1", - "MyCatalog1", - new ListDeviceGroupsRequest().withDeviceGroupName("MyDeviceGroup1"), - null, - null, - null, - null, - com.azure.core.util.Context.NONE); + manager.catalogs().listDeviceGroups("MyResourceGroup1", "MyCatalog1", + new ListDeviceGroupsRequest().withDeviceGroupName("MyDeviceGroup1"), null, null, null, null, + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceInsightsSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceInsightsSamples.java index 79f061be11916..ef493a48a9053 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceInsightsSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceInsightsSamples.java @@ -4,20 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Catalogs ListDeviceInsights. */ +/** + * Samples for Catalogs ListDeviceInsights. + */ public final class CatalogsListDeviceInsightsSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeviceInsightsCatalog.json + * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ + * PostListDeviceInsightsCatalog.json */ /** * Sample code: Catalogs_ListDeviceInsights. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsListDeviceInsights(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .catalogs() - .listDeviceInsights( - "MyResourceGroup1", "MyCatalog1", null, 10, null, null, com.azure.core.util.Context.NONE); + manager.catalogs().listDeviceInsights("MyResourceGroup1", "MyCatalog1", null, 10, null, null, + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDevicesSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDevicesSamples.java index efacfe7b38595..ba19e546a2b54 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDevicesSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListDevicesSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Catalogs ListDevices. */ +/** + * Samples for Catalogs ListDevices. + */ public final class CatalogsListDevicesSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDevicesByCatalog.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostListDevicesByCatalog. + * json */ /** * Sample code: Catalogs_ListDevices. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsListDevices(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .catalogs() - .listDevices("MyResourceGroup1", "MyCatalog1", null, null, null, null, com.azure.core.util.Context.NONE); + manager.catalogs().listDevices("MyResourceGroup1", "MyCatalog1", null, null, null, null, + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListSamples.java index cbca8f065c0ea..5171e9f9ee640 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsListSamples.java @@ -4,14 +4,17 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Catalogs List. */ +/** + * Samples for Catalogs List. + */ public final class CatalogsListSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalogsSub.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCatalogsSub.json */ /** * Sample code: Catalogs_ListBySubscription. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsListBySubscription(com.azure.resourcemanager.sphere.AzureSphereManager manager) { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsUpdateSamples.java index b403f511181dc..e22025f5572cc 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsUpdateSamples.java @@ -6,22 +6,23 @@ import com.azure.resourcemanager.sphere.models.Catalog; -/** Samples for Catalogs Update. */ +/** + * Samples for Catalogs Update. + */ public final class CatalogsUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchCatalog.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchCatalog.json */ /** * Sample code: Catalogs_Update. - * + * * @param manager Entry point to AzureSphereManager. */ public static void catalogsUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - Catalog resource = - manager - .catalogs() - .getByResourceGroupWithResponse("MyResourceGroup1", "MyCatalog1", com.azure.core.util.Context.NONE) - .getValue(); + Catalog resource = manager.catalogs() + .getByResourceGroupWithResponse("MyResourceGroup1", "MyCatalog1", com.azure.core.util.Context.NONE) + .getValue(); resource.update().apply(); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsUploadImageSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsUploadImageSamples.java new file mode 100644 index 0000000000000..dcc15f12a1375 --- /dev/null +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CatalogsUploadImageSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sphere.generated; + +import com.azure.resourcemanager.sphere.fluent.models.ImageInner; +import com.azure.resourcemanager.sphere.models.ImageProperties; + +/** + * Samples for Catalogs UploadImage. + */ +public final class CatalogsUploadImageSamples { + /* + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostUploadImageCatalog. + * json + */ + /** + * Sample code: Catalogs_UploadImage. + * + * @param manager Entry point to AzureSphereManager. + */ + public static void catalogsUploadImage(com.azure.resourcemanager.sphere.AzureSphereManager manager) { + manager.catalogs().uploadImage("MyResourceGroup1", "MyCatalog1", + new ImageInner().withProperties(new ImageProperties().withImage("bXliYXNlNjRzdHJpbmc=")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesGetSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesGetSamples.java index dd297530c5ce1..8a7d5fc255e37 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesGetSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesGetSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Certificates Get. */ +/** + * Samples for Certificates Get. + */ public final class CertificatesGetSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCertificate.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCertificate.json */ /** * Sample code: Certificates_Get. - * + * * @param manager Entry point to AzureSphereManager. */ public static void certificatesGet(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .certificates() - .getWithResponse("MyResourceGroup1", "MyCatalog1", "default", com.azure.core.util.Context.NONE); + manager.certificates().getWithResponse("MyResourceGroup1", "MyCatalog1", "default", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesListByCatalogSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesListByCatalogSamples.java index 5e3fb21f0a195..3d33950347e85 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesListByCatalogSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesListByCatalogSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Certificates ListByCatalog. */ +/** + * Samples for Certificates ListByCatalog. + */ public final class CertificatesListByCatalogSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCertificates.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetCertificates.json */ /** * Sample code: Certificates_ListByCatalog. - * + * * @param manager Entry point to AzureSphereManager. */ public static void certificatesListByCatalog(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .certificates() - .listByCatalog("MyResourceGroup1", "MyCatalog1", null, null, null, null, com.azure.core.util.Context.NONE); + manager.certificates().listByCatalog("MyResourceGroup1", "MyCatalog1", null, null, null, null, + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveCertChainSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveCertChainSamples.java index a93dae6623043..7fdfb2a053605 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveCertChainSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveCertChainSamples.java @@ -4,20 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Certificates RetrieveCertChain. */ +/** + * Samples for Certificates RetrieveCertChain. + */ public final class CertificatesRetrieveCertChainSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostRetrieveCatalogCertChain.json + * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ + * PostRetrieveCatalogCertChain.json */ /** * Sample code: Certificates_RetrieveCertChain. - * + * * @param manager Entry point to AzureSphereManager. */ public static void certificatesRetrieveCertChain(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .certificates() - .retrieveCertChainWithResponse( - "MyResourceGroup1", "MyCatalog1", "active", com.azure.core.util.Context.NONE); + manager.certificates().retrieveCertChainWithResponse("MyResourceGroup1", "MyCatalog1", "active", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveProofOfPossessionNonceSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveProofOfPossessionNonceSamples.java index e0d1984755302..f3893547209f9 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveProofOfPossessionNonceSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveProofOfPossessionNonceSamples.java @@ -6,25 +6,23 @@ import com.azure.resourcemanager.sphere.models.ProofOfPossessionNonceRequest; -/** Samples for Certificates RetrieveProofOfPossessionNonce. */ +/** + * Samples for Certificates RetrieveProofOfPossessionNonce. + */ public final class CertificatesRetrieveProofOfPossessionNonceSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostRetrieveProofOfPossessionNonce.json + * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ + * PostRetrieveProofOfPossessionNonce.json */ /** * Sample code: Certificates_RetrieveProofOfPossessionNonce. - * + * * @param manager Entry point to AzureSphereManager. */ - public static void certificatesRetrieveProofOfPossessionNonce( - com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .certificates() - .retrieveProofOfPossessionNonceWithResponse( - "MyResourceGroup1", - "MyCatalog1", - "active", - new ProofOfPossessionNonceRequest().withProofOfPossessionNonce("proofOfPossessionNonce"), - com.azure.core.util.Context.NONE); + public static void + certificatesRetrieveProofOfPossessionNonce(com.azure.resourcemanager.sphere.AzureSphereManager manager) { + manager.certificates().retrieveProofOfPossessionNonceWithResponse("MyResourceGroup1", "MyCatalog1", "active", + new ProofOfPossessionNonceRequest().withProofOfPossessionNonce("proofOfPossessionNonce"), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsCreateOrUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsCreateOrUpdateSamples.java index f7c1b3f6f9ba2..f88e47e470a64 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsCreateOrUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsCreateOrUpdateSamples.java @@ -4,21 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Deployments CreateOrUpdate. */ +/** + * Samples for Deployments CreateOrUpdate. + */ public final class DeploymentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDeployment.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutDeployment.json */ /** * Sample code: Deployments_CreateOrUpdate. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deploymentsCreateOrUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deployments() - .define("MyDeployment1") - .withExistingDeviceGroup("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1") - .create(); + manager.deployments().define("MyDeployment1") + .withExistingDeviceGroup("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1").create(); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsDeleteSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsDeleteSamples.java index 76bccb55eba05..72ae93fe3f1df 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsDeleteSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsDeleteSamples.java @@ -4,25 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Deployments Delete. */ +/** + * Samples for Deployments Delete. + */ public final class DeploymentsDeleteSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDeployment.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteDeployment.json */ /** * Sample code: Deployments_Delete. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deploymentsDelete(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deployments() - .delete( - "MyResourceGroup1", - "MyCatalog1", - "MyProductName1", - "DeviceGroupName1", - "MyDeploymentName1", - com.azure.core.util.Context.NONE); + manager.deployments().delete("MyResourceGroup1", "MyCatalog1", "MyProductName1", "DeviceGroupName1", + "MyDeploymentName1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsGetSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsGetSamples.java index 275984e3dc927..9179cd7968628 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsGetSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsGetSamples.java @@ -4,25 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Deployments Get. */ +/** + * Samples for Deployments Get. + */ public final class DeploymentsGetSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeployment.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeployment.json */ /** * Sample code: Deployments_Get. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deploymentsGet(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deployments() - .getWithResponse( - "MyResourceGroup1", - "MyCatalog1", - "MyProduct1", - "myDeviceGroup1", - "MyDeployment1", - com.azure.core.util.Context.NONE); + manager.deployments().getWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1", + "MyDeployment1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsListByDeviceGroupSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsListByDeviceGroupSamples.java index 609509e0cbb9b..35084689ffd01 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsListByDeviceGroupSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeploymentsListByDeviceGroupSamples.java @@ -4,28 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Deployments ListByDeviceGroup. */ +/** + * Samples for Deployments ListByDeviceGroup. + */ public final class DeploymentsListByDeviceGroupSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeployments.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeployments.json */ /** * Sample code: Deployments_ListByDeviceGroup. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deploymentsListByDeviceGroup(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deployments() - .listByDeviceGroup( - "MyResourceGroup1", - "MyCatalog1", - "MyProduct1", - "myDeviceGroup1", - null, - null, - null, - null, - com.azure.core.util.Context.NONE); + manager.deployments().listByDeviceGroup("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1", null, + null, null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsClaimDevicesSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsClaimDevicesSamples.java index 75face00b784e..e41bfdfa6b1e2 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsClaimDevicesSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsClaimDevicesSamples.java @@ -7,29 +7,23 @@ import com.azure.resourcemanager.sphere.models.ClaimDevicesRequest; import java.util.Arrays; -/** Samples for DeviceGroups ClaimDevices. */ +/** + * Samples for DeviceGroups ClaimDevices. + */ public final class DeviceGroupsClaimDevicesSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostClaimDevices.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostClaimDevices.json */ /** * Sample code: DeviceGroups_ClaimDevices. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deviceGroupsClaimDevices(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deviceGroups() - .claimDevices( - "MyResourceGroup1", - "MyCatalog1", - "MyProduct1", - "MyDeviceGroup1", - new ClaimDevicesRequest() - .withDeviceIdentifiers( - Arrays - .asList( - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")), - com.azure.core.util.Context.NONE); + manager.deviceGroups().claimDevices("MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", + new ClaimDevicesRequest().withDeviceIdentifiers(Arrays.asList( + "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCountDevicesSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCountDevicesSamples.java index b8f9b52c5f86a..417723a372ecc 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCountDevicesSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCountDevicesSamples.java @@ -4,20 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for DeviceGroups CountDevices. */ +/** + * Samples for DeviceGroups CountDevices. + */ public final class DeviceGroupsCountDevicesSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesDeviceGroup.json + * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ + * PostCountDevicesDeviceGroup.json */ /** * Sample code: DeviceGroups_CountDevices. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deviceGroupsCountDevices(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deviceGroups() - .countDevicesWithResponse( - "MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", com.azure.core.util.Context.NONE); + manager.deviceGroups().countDevicesWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", + "MyDeviceGroup1", com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCreateOrUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCreateOrUpdateSamples.java index 7d080fbac1ffe..757c2d3de33a6 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCreateOrUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCreateOrUpdateSamples.java @@ -4,27 +4,28 @@ package com.azure.resourcemanager.sphere.generated; +import com.azure.resourcemanager.sphere.models.DeviceGroupProperties; import com.azure.resourcemanager.sphere.models.OSFeedType; import com.azure.resourcemanager.sphere.models.UpdatePolicy; -/** Samples for DeviceGroups CreateOrUpdate. */ +/** + * Samples for DeviceGroups CreateOrUpdate. + */ public final class DeviceGroupsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDeviceGroup.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutDeviceGroup.json */ /** * Sample code: DeviceGroups_CreateOrUpdate. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deviceGroupsCreateOrUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deviceGroups() - .define("MyDeviceGroup1") + manager.deviceGroups().define("MyDeviceGroup1") .withExistingProduct("MyResourceGroup1", "MyCatalog1", "MyProduct1") - .withDescription("Description for MyDeviceGroup1") - .withOsFeedType(OSFeedType.RETAIL) - .withUpdatePolicy(UpdatePolicy.UPDATE_ALL) + .withProperties(new DeviceGroupProperties().withDescription("Description for MyDeviceGroup1") + .withOsFeedType(OSFeedType.RETAIL).withUpdatePolicy(UpdatePolicy.UPDATE_ALL)) .create(); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsDeleteSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsDeleteSamples.java index 8bca32f3dd902..63394eb71fc62 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsDeleteSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsDeleteSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for DeviceGroups Delete. */ +/** + * Samples for DeviceGroups Delete. + */ public final class DeviceGroupsDeleteSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDeviceGroup.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteDeviceGroup.json */ /** * Sample code: DeviceGroups_Delete. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deviceGroupsDelete(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deviceGroups() - .delete("MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", com.azure.core.util.Context.NONE); + manager.deviceGroups().delete("MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsGetSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsGetSamples.java index f670f901cc1a4..2f49c0aeb21dd 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsGetSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsGetSamples.java @@ -4,20 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for DeviceGroups Get. */ +/** + * Samples for DeviceGroups Get. + */ public final class DeviceGroupsGetSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeviceGroup.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeviceGroup.json */ /** * Sample code: DeviceGroups_Get. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deviceGroupsGet(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deviceGroups() - .getWithResponse( - "MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", com.azure.core.util.Context.NONE); + manager.deviceGroups().getWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsListByProductSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsListByProductSamples.java index 58f6957cba471..830df666d347b 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsListByProductSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsListByProductSamples.java @@ -4,27 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for DeviceGroups ListByProduct. */ +/** + * Samples for DeviceGroups ListByProduct. + */ public final class DeviceGroupsListByProductSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeviceGroups.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDeviceGroups.json */ /** * Sample code: DeviceGroups_ListByProduct. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deviceGroupsListByProduct(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .deviceGroups() - .listByProduct( - "MyResourceGroup1", - "MyCatalog1", - "MyProduct1", - null, - null, - null, - null, - com.azure.core.util.Context.NONE); + manager.deviceGroups().listByProduct("MyResourceGroup1", "MyCatalog1", "MyProduct1", null, null, null, null, + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsUpdateSamples.java index de3020b0344c9..38228e0b95184 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsUpdateSamples.java @@ -6,23 +6,22 @@ import com.azure.resourcemanager.sphere.models.DeviceGroup; -/** Samples for DeviceGroups Update. */ +/** + * Samples for DeviceGroups Update. + */ public final class DeviceGroupsUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchDeviceGroup.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchDeviceGroup.json */ /** * Sample code: DeviceGroups_Update. - * + * * @param manager Entry point to AzureSphereManager. */ public static void deviceGroupsUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - DeviceGroup resource = - manager - .deviceGroups() - .getWithResponse( - "MyResourceGroup1", "MyCatalog1", "MyProduct1", "MyDeviceGroup1", com.azure.core.util.Context.NONE) - .getValue(); + DeviceGroup resource = manager.deviceGroups().getWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", + "MyDeviceGroup1", com.azure.core.util.Context.NONE).getValue(); resource.update().apply(); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesCreateOrUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesCreateOrUpdateSamples.java index fa3f3e079bf00..b549d4b03c751 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesCreateOrUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesCreateOrUpdateSamples.java @@ -4,22 +4,22 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Devices CreateOrUpdate. */ +/** + * Samples for Devices CreateOrUpdate. + */ public final class DevicesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDevice.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutDevice.json */ /** * Sample code: Devices_CreateOrUpdate. - * + * * @param manager Entry point to AzureSphereManager. */ public static void devicesCreateOrUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .devices() - .define( - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") - .withExistingDeviceGroup("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1") - .create(); + manager.devices().define( + "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") + .withExistingDeviceGroup("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1").create(); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesDeleteSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesDeleteSamples.java index 07cb659d05313..0f05b19ae8e9d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesDeleteSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesDeleteSamples.java @@ -4,25 +4,22 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Devices Delete. */ +/** + * Samples for Devices Delete. + */ public final class DevicesDeleteSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDevice.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteDevice.json */ /** * Sample code: Devices_Delete. - * + * * @param manager Entry point to AzureSphereManager. */ public static void devicesDelete(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .devices() - .delete( - "MyResourceGroup1", - "MyCatalog1", - "MyProductName1", - "DeviceGroupName1", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - com.azure.core.util.Context.NONE); + manager.devices().delete("MyResourceGroup1", "MyCatalog1", "MyProductName1", "DeviceGroupName1", + "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesGenerateCapabilityImageSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesGenerateCapabilityImageSamples.java index f1cd433d951b2..c50b6947e56e7 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesGenerateCapabilityImageSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesGenerateCapabilityImageSamples.java @@ -8,27 +8,24 @@ import com.azure.resourcemanager.sphere.models.GenerateCapabilityImageRequest; import java.util.Arrays; -/** Samples for Devices GenerateCapabilityImage. */ +/** + * Samples for Devices GenerateCapabilityImage. + */ public final class DevicesGenerateCapabilityImageSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostGenerateDeviceCapabilityImage.json + * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ + * PostGenerateDeviceCapabilityImage.json */ /** * Sample code: Devices_GenerateCapabilityImage. - * + * * @param manager Entry point to AzureSphereManager. */ public static void devicesGenerateCapabilityImage(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .devices() - .generateCapabilityImage( - "MyResourceGroup1", - "MyCatalog1", - "MyProduct1", - "myDeviceGroup1", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - new GenerateCapabilityImageRequest() - .withCapabilities(Arrays.asList(CapabilityType.APPLICATION_DEVELOPMENT)), - com.azure.core.util.Context.NONE); + manager.devices().generateCapabilityImage("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1", + "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + new GenerateCapabilityImageRequest().withCapabilities( + Arrays.asList(CapabilityType.APPLICATION_DEVELOPMENT)), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesGetSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesGetSamples.java index 6e13f61296581..d1d4264593aa4 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesGetSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesGetSamples.java @@ -4,25 +4,22 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Devices Get. */ +/** + * Samples for Devices Get. + */ public final class DevicesGetSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDevice.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDevice.json */ /** * Sample code: Devices_Get. - * + * * @param manager Entry point to AzureSphereManager. */ public static void devicesGet(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .devices() - .getWithResponse( - "MyResourceGroup1", - "MyCatalog1", - "MyProduct1", - "myDeviceGroup1", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - com.azure.core.util.Context.NONE); + manager.devices().getWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1", + "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesListByDeviceGroupSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesListByDeviceGroupSamples.java index 0ebc32822d157..4efea809c5825 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesListByDeviceGroupSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesListByDeviceGroupSamples.java @@ -4,20 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Devices ListByDeviceGroup. */ +/** + * Samples for Devices ListByDeviceGroup. + */ public final class DevicesListByDeviceGroupSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDevices.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetDevices.json */ /** * Sample code: Devices_ListByDeviceGroup. - * + * * @param manager Entry point to AzureSphereManager. */ public static void devicesListByDeviceGroup(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .devices() - .listByDeviceGroup( - "MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1", com.azure.core.util.Context.NONE); + manager.devices().listByDeviceGroup("MyResourceGroup1", "MyCatalog1", "MyProduct1", "myDeviceGroup1", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesUpdateSamples.java index fac4d4f386721..a7d30f3514f72 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/DevicesUpdateSamples.java @@ -6,28 +6,24 @@ import com.azure.resourcemanager.sphere.models.Device; -/** Samples for Devices Update. */ +/** + * Samples for Devices Update. + */ public final class DevicesUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchDevice.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchDevice.json */ /** * Sample code: Devices_Update. - * + * * @param manager Entry point to AzureSphereManager. */ public static void devicesUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - Device resource = - manager - .devices() - .getWithResponse( - "MyResourceGroup1", - "MyCatalog1", - "MyProduct1", - "MyDeviceGroup1", - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - com.azure.core.util.Context.NONE) - .getValue(); + Device resource = manager.devices().getWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", + "MyDeviceGroup1", + "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + com.azure.core.util.Context.NONE).getValue(); resource.update().apply(); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesCreateOrUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesCreateOrUpdateSamples.java index 439986767c4d7..1637da43bbb6e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesCreateOrUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesCreateOrUpdateSamples.java @@ -4,22 +4,24 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Images CreateOrUpdate. */ +import com.azure.resourcemanager.sphere.models.ImageProperties; + +/** + * Samples for Images CreateOrUpdate. + */ public final class ImagesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutImage.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutImage.json */ /** * Sample code: Image_CreateOrUpdate. - * + * * @param manager Entry point to AzureSphereManager. */ public static void imageCreateOrUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .images() - .define("default") + manager.images().define("00000000-0000-0000-0000-000000000000") .withExistingCatalog("MyResourceGroup1", "MyCatalog1") - .withImage("bXliYXNlNjRzdHJpbmc=") - .create(); + .withProperties(new ImageProperties().withImage("bXliYXNlNjRzdHJpbmc=")).create(); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesDeleteSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesDeleteSamples.java index 2b145b19ae591..ca298c7ffa88c 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesDeleteSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesDeleteSamples.java @@ -4,17 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Images Delete. */ +/** + * Samples for Images Delete. + */ public final class ImagesDeleteSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteImage.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteImage.json */ /** * Sample code: Images_Delete. - * + * * @param manager Entry point to AzureSphereManager. */ public static void imagesDelete(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager.images().delete("MyResourceGroup1", "MyCatalog1", "imageID", com.azure.core.util.Context.NONE); + manager.images().delete("MyResourceGroup1", "MyCatalog1", "00000000-0000-0000-0000-000000000000", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesGetSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesGetSamples.java index 6834a1b62380c..5941a50677feb 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesGetSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesGetSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Images Get. */ +/** + * Samples for Images Get. + */ public final class ImagesGetSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetImage.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetImage.json */ /** * Sample code: Images_Get. - * + * * @param manager Entry point to AzureSphereManager. */ public static void imagesGet(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .images() - .getWithResponse("MyResourceGroup1", "MyCatalog1", "myImageId", com.azure.core.util.Context.NONE); + manager.images().getWithResponse("MyResourceGroup1", "MyCatalog1", "00000000-0000-0000-0000-000000000000", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesListByCatalogSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesListByCatalogSamples.java index 3df520e62c0ae..d3afc98bbd240 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesListByCatalogSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ImagesListByCatalogSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Images ListByCatalog. */ +/** + * Samples for Images ListByCatalog. + */ public final class ImagesListByCatalogSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetImages.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetImages.json */ /** * Sample code: Images_ListByCatalog. - * + * * @param manager Entry point to AzureSphereManager. */ public static void imagesListByCatalog(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .images() - .listByCatalog("MyResourceGroup1", "MyCatalog1", null, null, null, null, com.azure.core.util.Context.NONE); + manager.images().listByCatalog("MyResourceGroup1", "MyCatalog1", null, null, null, null, + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/OperationsListSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/OperationsListSamples.java index 1644d16ecb87b..a11da63ebadb2 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/OperationsListSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/OperationsListSamples.java @@ -4,14 +4,17 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetOperations.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetOperations.json */ /** * Sample code: Operations_List. - * + * * @param manager Entry point to AzureSphereManager. */ public static void operationsList(com.azure.resourcemanager.sphere.AzureSphereManager manager) { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsCountDevicesSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsCountDevicesSamples.java index c2fbb80de7d03..0929cda53110b 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsCountDevicesSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsCountDevicesSamples.java @@ -4,19 +4,22 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Products CountDevices. */ +/** + * Samples for Products CountDevices. + */ public final class ProductsCountDevicesSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesProduct.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PostCountDevicesProduct. + * json */ /** * Sample code: Products_CountDevices. - * + * * @param manager Entry point to AzureSphereManager. */ public static void productsCountDevices(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .products() - .countDevicesWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", com.azure.core.util.Context.NONE); + manager.products().countDevicesWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsCreateOrUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsCreateOrUpdateSamples.java index f4b464e1d8b56..c487141ce71cc 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsCreateOrUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsCreateOrUpdateSamples.java @@ -4,14 +4,17 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Products CreateOrUpdate. */ +/** + * Samples for Products CreateOrUpdate. + */ public final class ProductsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutProduct.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PutProduct.json */ /** * Sample code: Products_CreateOrUpdate. - * + * * @param manager Entry point to AzureSphereManager. */ public static void productsCreateOrUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsDeleteSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsDeleteSamples.java index bf1b143a5ec91..b8664ba9eaf4c 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsDeleteSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsDeleteSamples.java @@ -4,14 +4,17 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Products Delete. */ +/** + * Samples for Products Delete. + */ public final class ProductsDeleteSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteProduct.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/DeleteProduct.json */ /** * Sample code: Products_Delete. - * + * * @param manager Entry point to AzureSphereManager. */ public static void productsDelete(com.azure.resourcemanager.sphere.AzureSphereManager manager) { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsGenerateDefaultDeviceGroupsSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsGenerateDefaultDeviceGroupsSamples.java index dea33d91b4257..ed749735aac97 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsGenerateDefaultDeviceGroupsSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsGenerateDefaultDeviceGroupsSamples.java @@ -4,21 +4,22 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Products GenerateDefaultDeviceGroups. */ +/** + * Samples for Products GenerateDefaultDeviceGroups. + */ public final class ProductsGenerateDefaultDeviceGroupsSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostGenerateDefaultDeviceGroups.json + * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/ + * PostGenerateDefaultDeviceGroups.json */ /** * Sample code: Products_GenerateDefaultDeviceGroups. - * + * * @param manager Entry point to AzureSphereManager. */ - public static void productsGenerateDefaultDeviceGroups( - com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .products() - .generateDefaultDeviceGroups( - "MyResourceGroup1", "MyCatalog1", "MyProduct1", com.azure.core.util.Context.NONE); + public static void + productsGenerateDefaultDeviceGroups(com.azure.resourcemanager.sphere.AzureSphereManager manager) { + manager.products().generateDefaultDeviceGroups("MyResourceGroup1", "MyCatalog1", "MyProduct1", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsGetSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsGetSamples.java index 0adf122c027f1..02d84879b5931 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsGetSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsGetSamples.java @@ -4,19 +4,21 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Products Get. */ +/** + * Samples for Products Get. + */ public final class ProductsGetSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetProduct.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetProduct.json */ /** * Sample code: Products_Get. - * + * * @param manager Entry point to AzureSphereManager. */ public static void productsGet(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - manager - .products() - .getWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", com.azure.core.util.Context.NONE); + manager.products().getWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsListByCatalogSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsListByCatalogSamples.java index 77d7f7e2b1062..0518ce64f8725 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsListByCatalogSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsListByCatalogSamples.java @@ -4,14 +4,17 @@ package com.azure.resourcemanager.sphere.generated; -/** Samples for Products ListByCatalog. */ +/** + * Samples for Products ListByCatalog. + */ public final class ProductsListByCatalogSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetProducts.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/GetProducts.json */ /** * Sample code: Products_ListByCatalog. - * + * * @param manager Entry point to AzureSphereManager. */ public static void productsListByCatalog(com.azure.resourcemanager.sphere.AzureSphereManager manager) { diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsUpdateSamples.java b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsUpdateSamples.java index 96e2a0ca437ae..58b204a769434 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsUpdateSamples.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/samples/java/com/azure/resourcemanager/sphere/generated/ProductsUpdateSamples.java @@ -6,22 +6,23 @@ import com.azure.resourcemanager.sphere.models.Product; -/** Samples for Products Update. */ +/** + * Samples for Products Update. + */ public final class ProductsUpdateSamples { /* - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchProduct.json + * x-ms-original-file: + * specification/sphere/resource-manager/Microsoft.AzureSphere/stable/2024-04-01/examples/PatchProduct.json */ /** * Sample code: Products_Update. - * + * * @param manager Entry point to AzureSphereManager. */ public static void productsUpdate(com.azure.resourcemanager.sphere.AzureSphereManager manager) { - Product resource = - manager - .products() - .getWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", com.azure.core.util.Context.NONE) - .getValue(); + Product resource = manager.products() + .getWithResponse("MyResourceGroup1", "MyCatalog1", "MyProduct1", com.azure.core.util.Context.NONE) + .getValue(); resource.update().apply(); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogInnerTests.java index 6962083bbbef2..f5860910910d6 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogInnerTests.java @@ -6,6 +6,7 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.sphere.fluent.models.CatalogInner; +import com.azure.resourcemanager.sphere.models.CatalogProperties; import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Assertions; @@ -13,35 +14,24 @@ public final class CatalogInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CatalogInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Accepted\"},\"location\":\"lokjyemkk\",\"tags\":{\"ejspodmail\":\"pjoxzjnch\",\"yahux\":\"ydehoj\",\"vcputegj\":\"npmqnjaqwixjspro\",\"uuvmkjozkrwfnd\":\"wmfdatscmdvpjhul\"},\"id\":\"odjpslwejd\",\"name\":\"vwryoqpso\",\"type\":\"cctazakljlahbc\"}") - .toObject(CatalogInner.class); - Assertions.assertEquals("lokjyemkk", model.location()); - Assertions.assertEquals("pjoxzjnch", model.tags().get("ejspodmail")); + CatalogInner model = BinaryData.fromString( + "{\"properties\":{\"tenantId\":\"vpjhulsuuv\",\"provisioningState\":\"Failed\"},\"location\":\"zkrwfn\",\"tags\":{\"jdpvwryo\":\"djpslw\",\"hbcryffdfdosyge\":\"psoacctazakljl\",\"rzevdphlxaol\":\"paojakhmsbzjh\"},\"id\":\"hqtrgqjbpf\",\"name\":\"fsinzgvfcjrwzoxx\",\"type\":\"tfell\"}") + .toObject(CatalogInner.class); + Assertions.assertEquals("zkrwfn", model.location()); + Assertions.assertEquals("djpslw", model.tags().get("jdpvwryo")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CatalogInner model = - new CatalogInner() - .withLocation("lokjyemkk") - .withTags( - mapOf( - "ejspodmail", - "pjoxzjnch", - "yahux", - "ydehoj", - "vcputegj", - "npmqnjaqwixjspro", - "uuvmkjozkrwfnd", - "wmfdatscmdvpjhul")); + CatalogInner model = new CatalogInner().withLocation("zkrwfn") + .withTags(mapOf("jdpvwryo", "djpslw", "hbcryffdfdosyge", "psoacctazakljl", "rzevdphlxaol", "paojakhmsbzjh")) + .withProperties(new CatalogProperties()); model = BinaryData.fromObject(model).toObject(CatalogInner.class); - Assertions.assertEquals("lokjyemkk", model.location()); - Assertions.assertEquals("pjoxzjnch", model.tags().get("ejspodmail")); + Assertions.assertEquals("zkrwfn", model.location()); + Assertions.assertEquals("djpslw", model.tags().get("jdpvwryo")); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogListResultTests.java index a8865709acb79..56fd7b612858e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogListResultTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogListResultTests.java @@ -7,6 +7,7 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.sphere.fluent.models.CatalogInner; import com.azure.resourcemanager.sphere.models.CatalogListResult; +import com.azure.resourcemanager.sphere.models.CatalogProperties; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -15,33 +16,28 @@ public final class CatalogListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CatalogListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\"},\"location\":\"hxqh\",\"tags\":{\"scnpqxuhivy\":\"fpikxwczb\",\"wby\":\"n\",\"grtfwvu\":\"rkxvdum\"},\"id\":\"xgaudccs\",\"name\":\"h\",\"type\":\"jcny\"}],\"nextLink\":\"hkryhtn\"}") - .toObject(CatalogListResult.class); - Assertions.assertEquals("hxqh", model.value().get(0).location()); - Assertions.assertEquals("fpikxwczb", model.value().get(0).tags().get("scnpqxuhivy")); - Assertions.assertEquals("hkryhtn", model.nextLink()); + CatalogListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"tenantId\":\"ithxqhabifpi\",\"provisioningState\":\"Accepted\"},\"location\":\"zb\",\"tags\":{\"vyq\":\"npqxuh\",\"tfwvukxgaudc\":\"iwbybrkxvdumjg\",\"napczwlokjy\":\"snhsjcnyejhkryh\",\"oxzjnchgejspod\":\"mkkvnip\"},\"id\":\"ailzydehojwyahu\",\"name\":\"inpm\",\"type\":\"njaqwixjspro\"}],\"nextLink\":\"cputegjvwmfdats\"}") + .toObject(CatalogListResult.class); + Assertions.assertEquals("zb", model.value().get(0).location()); + Assertions.assertEquals("npqxuh", model.value().get(0).tags().get("vyq")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CatalogListResult model = - new CatalogListResult() + CatalogListResult model + = new CatalogListResult() .withValue( - Arrays - .asList( - new CatalogInner() - .withLocation("hxqh") - .withTags(mapOf("scnpqxuhivy", "fpikxwczb", "wby", "n", "grtfwvu", "rkxvdum")))) - .withNextLink("hkryhtn"); + Arrays.asList(new CatalogInner() + .withLocation("zb").withTags(mapOf("vyq", "npqxuh", "tfwvukxgaudc", "iwbybrkxvdumjg", + "napczwlokjy", "snhsjcnyejhkryh", "oxzjnchgejspod", "mkkvnip")) + .withProperties(new CatalogProperties()))); model = BinaryData.fromObject(model).toObject(CatalogListResult.class); - Assertions.assertEquals("hxqh", model.value().get(0).location()); - Assertions.assertEquals("fpikxwczb", model.value().get(0).tags().get("scnpqxuhivy")); - Assertions.assertEquals("hkryhtn", model.nextLink()); + Assertions.assertEquals("zb", model.value().get(0).location()); + Assertions.assertEquals("npqxuh", model.value().get(0).tags().get("vyq")); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogPropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogPropertiesTests.java index 92506c4b6bb33..6b9c7983e55ae 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogPropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogPropertiesTests.java @@ -5,13 +5,13 @@ package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.CatalogProperties; +import com.azure.resourcemanager.sphere.models.CatalogProperties; public final class CatalogPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CatalogProperties model = - BinaryData.fromString("{\"provisioningState\":\"Provisioning\"}").toObject(CatalogProperties.class); + CatalogProperties model = BinaryData.fromString("{\"tenantId\":\"fziton\",\"provisioningState\":\"Failed\"}") + .toObject(CatalogProperties.class); } @org.junit.jupiter.api.Test diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogUpdateTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogUpdateTests.java index a1076b1954073..94d41f62fe14a 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogUpdateTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogUpdateTests.java @@ -13,23 +13,22 @@ public final class CatalogUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CatalogUpdate model = - BinaryData - .fromString( - "{\"tags\":{\"xpaojakhmsbz\":\"fdosyg\",\"hlxaolthqtr\":\"hcrzevd\",\"gvfcj\":\"qjbpfzfsin\"}}") - .toObject(CatalogUpdate.class); - Assertions.assertEquals("fdosyg", model.tags().get("xpaojakhmsbz")); + CatalogUpdate model = BinaryData + .fromString( + "{\"tags\":{\"ypininm\":\"jkjlxofpdvhpfx\",\"po\":\"yhuybbkpod\",\"ognarxzxtheotus\":\"ginuvamih\"}}") + .toObject(CatalogUpdate.class); + Assertions.assertEquals("jkjlxofpdvhpfx", model.tags().get("ypininm")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CatalogUpdate model = - new CatalogUpdate() - .withTags(mapOf("xpaojakhmsbz", "fdosyg", "hlxaolthqtr", "hcrzevd", "gvfcj", "qjbpfzfsin")); + CatalogUpdate model = new CatalogUpdate() + .withTags(mapOf("ypininm", "jkjlxofpdvhpfx", "po", "yhuybbkpod", "ognarxzxtheotus", "ginuvamih")); model = BinaryData.fromObject(model).toObject(CatalogUpdate.class); - Assertions.assertEquals("fdosyg", model.tags().get("xpaojakhmsbz")); + Assertions.assertEquals("jkjlxofpdvhpfx", model.tags().get("ypininm")); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCountDevicesWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCountDevicesWithResponseMockTests.java index b65131b0794fd..819919f6531dc 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCountDevicesWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCountDevicesWithResponseMockTests.java @@ -12,7 +12,7 @@ import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; import com.azure.resourcemanager.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.CountDeviceResponse; +import com.azure.resourcemanager.sphere.models.CountDevicesResponse; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; @@ -30,37 +30,26 @@ public void testCountDevicesWithResponse() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":427278595}"; + String responseStr = "{\"value\":1560245881}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - CountDeviceResponse response = - manager.catalogs().countDevicesWithResponse("bkyvp", "ca", com.azure.core.util.Context.NONE).getValue(); + CountDevicesResponse response = manager.catalogs() + .countDevicesWithResponse("cjooxdjebwpucwwf", "ovbvmeueciv", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals(427278595, response.value()); + Assertions.assertEquals(1560245881, response.value()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCreateOrUpdateMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCreateOrUpdateMockTests.java index 8b2d78d783367..d685320695650 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCreateOrUpdateMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsCreateOrUpdateMockTests.java @@ -13,6 +13,7 @@ import com.azure.core.management.profile.AzureProfile; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Catalog; +import com.azure.resourcemanager.sphere.models.CatalogProperties; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; @@ -32,48 +33,34 @@ public void testCreateOrUpdate() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"properties\":{\"provisioningState\":\"Succeeded\"},\"location\":\"lmpewwwfbkr\",\"tags\":{\"rsbfovasrruvw\":\"svshqjohx\"},\"id\":\"hsqfsubcgjbirxbp\",\"name\":\"bsrfbj\",\"type\":\"dtws\"}"; + String responseStr + = "{\"properties\":{\"tenantId\":\"yngudivk\",\"provisioningState\":\"Succeeded\"},\"location\":\"bxqz\",\"tags\":{\"e\":\"jfauvjfdxxi\"},\"id\":\"vtcqaqtdo\",\"name\":\"mcbxvwvxysl\",\"type\":\"bhsfxob\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Catalog response = - manager - .catalogs() - .define("mjh") - .withRegion("gudivkrtswbxqz") - .withExistingResourceGroup("rmfqjhhkxbpvj") - .withTags(mapOf("e", "jfauvjfdxxi")) - .create(); + Catalog response = manager.catalogs().define("zhxgktrmgucn").withRegion("lwptfdy") + .withExistingResourceGroup("medjvcslynqwwncw") + .withTags(mapOf("huaoppp", "qbuaceopzfqr", "z", "qeqxo", "moizpos", "ahzxctobgbk")) + .withProperties(new CatalogProperties()).create(); - Assertions.assertEquals("lmpewwwfbkr", response.location()); - Assertions.assertEquals("svshqjohx", response.tags().get("rsbfovasrruvw")); + Assertions.assertEquals("bxqz", response.location()); + Assertions.assertEquals("jfauvjfdxxi", response.tags().get("e")); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsDeleteMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsDeleteMockTests.java index a43539e369588..e9bba9bed6403 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsDeleteMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsDeleteMockTests.java @@ -32,30 +32,20 @@ public void testDelete() throws Exception { Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.catalogs().delete("hdzhlrqj", "hckfrlhrx", com.azure.core.util.Context.NONE); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.catalogs().delete("hashsfwxosow", "xcug", com.azure.core.util.Context.NONE); + } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsGetByResourceGroupWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsGetByResourceGroupWithResponseMockTests.java index be9d6977414b4..a5ec592630687 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsGetByResourceGroupWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsGetByResourceGroupWithResponseMockTests.java @@ -30,39 +30,28 @@ public void testGetByResourceGroupWithResponse() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"properties\":{\"provisioningState\":\"Accepted\"},\"location\":\"gxywpmue\",\"tags\":{\"bglaocqxtccm\":\"zwfqkqujidsuyon\"},\"id\":\"yudxytlmoy\",\"name\":\"xv\",\"type\":\"fudwpznt\"}"; + String responseStr + = "{\"properties\":{\"tenantId\":\"ag\",\"provisioningState\":\"Accepted\"},\"location\":\"elmqk\",\"tags\":{\"dhmdua\":\"hvljuahaquh\",\"pvfadmwsrcr\":\"aex\",\"fmisg\":\"vxpvgomz\"},\"id\":\"bnbbeldawkz\",\"name\":\"ali\",\"type\":\"urqhaka\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Catalog response = - manager.catalogs().getByResourceGroupWithResponse("ye", "sbj", com.azure.core.util.Context.NONE).getValue(); + Catalog response = manager.catalogs() + .getByResourceGroupWithResponse("ehhseyvjusrts", "hspkdeemao", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("gxywpmue", response.location()); - Assertions.assertEquals("zwfqkqujidsuyon", response.tags().get("bglaocqxtccm")); + Assertions.assertEquals("elmqk", response.location()); + Assertions.assertEquals("hvljuahaquh", response.tags().get("dhmdua")); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListByResourceGroupMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListByResourceGroupMockTests.java index 4c933ee635d93..0a3320a64b285 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListByResourceGroupMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListByResourceGroupMockTests.java @@ -31,39 +31,27 @@ public void testListByResourceGroup() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\"},\"location\":\"bkc\",\"tags\":{\"nv\":\"hbttkphyw\"},\"id\":\"t\",\"name\":\"qnermclfplphoxu\",\"type\":\"crpab\"}]}"; + String responseStr + = "{\"value\":[{\"properties\":{\"tenantId\":\"xy\",\"provisioningState\":\"Deleting\"},\"location\":\"yrxvwfudwpznt\",\"tags\":{\"ck\":\"zhlrqjb\",\"kyv\":\"rlhrxs\"},\"id\":\"ycanuzbpzkafku\",\"name\":\"b\",\"type\":\"rnwb\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = - manager.catalogs().listByResourceGroup("kvceoveilovnotyf", com.azure.core.util.Context.NONE); + PagedIterable response = manager.catalogs().listByResourceGroup("g", com.azure.core.util.Context.NONE); - Assertions.assertEquals("bkc", response.iterator().next().location()); - Assertions.assertEquals("hbttkphyw", response.iterator().next().tags().get("nv")); + Assertions.assertEquals("yrxvwfudwpznt", response.iterator().next().location()); + Assertions.assertEquals("zhlrqjb", response.iterator().next().tags().get("ck")); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeploymentsMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeploymentsMockTests.java index cb6c4fbc61b39..7f22830d823b9 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeploymentsMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeploymentsMockTests.java @@ -32,46 +32,33 @@ public void testListDeployments() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"properties\":{\"deploymentId\":\"v\",\"deployedImages\":[{\"properties\":{\"image\":\"slhs\",\"imageId\":\"deemao\",\"imageName\":\"xagkvtmelmqkrh\",\"regionalDataBoundary\":\"None\",\"uri\":\"juahaquhcdhmdual\",\"description\":\"xqpvfadmw\",\"componentId\":\"crgvxpvgom\",\"imageType\":\"WifiFirmware\",\"provisioningState\":\"Canceled\"},\"id\":\"sgwbnbbeld\",\"name\":\"wkz\",\"type\":\"ali\"},{\"properties\":{\"image\":\"qhakauhashsf\",\"imageId\":\"osow\",\"imageName\":\"cugicjoox\",\"regionalDataBoundary\":\"EU\",\"uri\":\"wpucwwfvovbv\",\"description\":\"uecivyhz\",\"componentId\":\"uojgj\",\"imageType\":\"SecurityMonitor\",\"provisioningState\":\"Succeeded\"},\"id\":\"iotwmcdytdxwit\",\"name\":\"nrjawgqwg\",\"type\":\"hniskxfbkpyc\"},{\"properties\":{\"image\":\"wndnhj\",\"imageId\":\"uwhvylwzbtdhxujz\",\"imageName\":\"mpowuwpr\",\"regionalDataBoundary\":\"None\",\"uri\":\"eualupjmkhf\",\"description\":\"bbcswsrtjri\",\"componentId\":\"rbpbewtghfgblcg\",\"imageType\":\"OneBl\",\"provisioningState\":\"Canceled\"},\"id\":\"v\",\"name\":\"hjkbegibtnmxieb\",\"type\":\"waloayqcgwr\"},{\"properties\":{\"image\":\"uzgwyzmhtx\",\"imageId\":\"gmtsavjcbpwxqpsr\",\"imageName\":\"ftguv\",\"regionalDataBoundary\":\"EU\",\"uri\":\"prwmdyvxqt\",\"description\":\"riwwroy\",\"componentId\":\"exrmcqibycnojvk\",\"imageType\":\"PlutonRuntime\",\"provisioningState\":\"Updating\"},\"id\":\"sgzvahapjyzhpv\",\"name\":\"qzcjrvxdj\",\"type\":\"lmwlxkvugfhzo\"}],\"deploymentDateUtc\":\"2021-09-30T03:16:16Z\",\"provisioningState\":\"Canceled\"},\"id\":\"zunlu\",\"name\":\"hnnpr\",\"type\":\"xipeilpjzuaejx\"}]}"; + String responseStr + = "{\"value\":[{\"properties\":{\"deploymentId\":\"jawgqwg\",\"deployedImages\":[{\"properties\":{\"image\":\"kxfbkpycgklwndn\",\"imageId\":\"dauwhvylwzbtd\",\"imageName\":\"ujznb\",\"regionalDataBoundary\":\"None\",\"uri\":\"uwprzql\",\"description\":\"ualupjmkh\",\"componentId\":\"obbc\",\"imageType\":\"CustomerBoardConfig\",\"provisioningState\":\"Updating\"},\"id\":\"riplrbpbewtg\",\"name\":\"fgb\",\"type\":\"c\"}],\"deploymentDateUtc\":\"2021-02-14T22:48:14Z\",\"provisioningState\":\"Accepted\"},\"id\":\"v\",\"name\":\"hjkbegibtnmxieb\",\"type\":\"waloayqcgwr\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = - manager - .catalogs() - .listDeployments( - "z", "p", "kafkuwbcrnwbm", 1542253292, 1688496747, 1198251199, com.azure.core.util.Context.NONE); + PagedIterable response = manager.catalogs().listDeployments("zceuojgjrw", "ueiotwmcdyt", "x", + 384724385, 1665373545, 838785311, com.azure.core.util.Context.NONE); - Assertions.assertEquals("v", response.iterator().next().deploymentId()); - Assertions.assertEquals("slhs", response.iterator().next().deployedImages().get(0).image()); - Assertions.assertEquals("deemao", response.iterator().next().deployedImages().get(0).imageId()); - Assertions - .assertEquals( - RegionalDataBoundary.NONE, response.iterator().next().deployedImages().get(0).regionalDataBoundary()); + Assertions.assertEquals("jawgqwg", response.iterator().next().properties().deploymentId()); + Assertions.assertEquals("kxfbkpycgklwndn", + response.iterator().next().properties().deployedImages().get(0).properties().image()); + Assertions.assertEquals("dauwhvylwzbtd", + response.iterator().next().properties().deployedImages().get(0).properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.NONE, + response.iterator().next().properties().deployedImages().get(0).properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceGroupsMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceGroupsMockTests.java index 5d57cacf9ab98..cba15c9b49563 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceGroupsMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceGroupsMockTests.java @@ -36,53 +36,35 @@ public void testListDeviceGroups() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"luu\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":false,\"provisioningState\":\"Updating\"},\"id\":\"v\",\"name\":\"elnsmvbxw\",\"type\":\"jsflhhcaalnjix\"}]}"; + String responseStr + = "{\"value\":[{\"properties\":{\"description\":\"iwwroyqbexrmc\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":true,\"provisioningState\":\"Accepted\"},\"id\":\"qsgzvahapj\",\"name\":\"zhpvgqzcjrvxd\",\"type\":\"zlmwlxkvugfhz\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = - manager - .catalogs() - .listDeviceGroups( - "ultskzbbtdz", - "mv", - new ListDeviceGroupsRequest().withDeviceGroupName("kgpwoz"), - "hkfpbs", - 820009390, - 657936288, - 205303620, - com.azure.core.util.Context.NONE); + PagedIterable response = manager.catalogs().listDeviceGroups("zjuzgwyz", "htxongmtsavjc", + new ListDeviceGroupsRequest().withDeviceGroupName("wxqpsrknftguvri"), "hprwmdyv", 1468047146, 1392355180, + 1817218794, com.azure.core.util.Context.NONE); - Assertions.assertEquals("luu", response.iterator().next().description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, response.iterator().next().osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, response.iterator().next().updatePolicy()); - Assertions - .assertEquals(AllowCrashDumpCollection.ENABLED, response.iterator().next().allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, response.iterator().next().regionalDataBoundary()); + Assertions.assertEquals("iwwroyqbexrmc", response.iterator().next().properties().description()); + Assertions.assertEquals(OSFeedType.RETAIL_EVAL, response.iterator().next().properties().osFeedType()); + Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, + response.iterator().next().properties().updatePolicy()); + Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, + response.iterator().next().properties().allowCrashDumpsCollection()); + Assertions.assertEquals(RegionalDataBoundary.NONE, + response.iterator().next().properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceInsightsMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceInsightsMockTests.java index 924deb5c4dad5..210566f5ad09c 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceInsightsMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDeviceInsightsMockTests.java @@ -31,56 +31,36 @@ public void testListDeviceInsights() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"deviceId\":\"ztfolhbnxk\",\"description\":\"alaulppggdtpnapn\",\"startTimestampUtc\":\"2021-01-27T00:10:34Z\",\"endTimestampUtc\":\"2021-04-06T21:45:28Z\",\"eventCategory\":\"opuhpig\",\"eventClass\":\"pgylg\",\"eventType\":\"git\",\"eventCount\":1973221194}]}"; + String responseStr + = "{\"value\":[{\"deviceId\":\"skzbb\",\"description\":\"dzumveekg\",\"startTimestampUtc\":\"2021-02-08T12:29:03Z\",\"endTimestampUtc\":\"2021-07-01T08:04:50Z\",\"eventCategory\":\"zuhkfpbsjyof\",\"eventClass\":\"xl\",\"eventType\":\"us\",\"eventCount\":1856979158}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = - manager - .catalogs() - .listDeviceInsights( - "sxyawjoyaqcs", - "yjpkiidzyexz", - "eli", - 1911330715, - 462425094, - 705550222, - com.azure.core.util.Context.NONE); + PagedIterable response = manager.catalogs().listDeviceInsights("vawjvzunlu", "hnnpr", + "xipeilpjzuaejx", 677451354, 122222845, 1732418843, com.azure.core.util.Context.NONE); - Assertions.assertEquals("ztfolhbnxk", response.iterator().next().deviceId()); - Assertions.assertEquals("alaulppggdtpnapn", response.iterator().next().description()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-01-27T00:10:34Z"), response.iterator().next().startTimestampUtc()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-04-06T21:45:28Z"), response.iterator().next().endTimestampUtc()); - Assertions.assertEquals("opuhpig", response.iterator().next().eventCategory()); - Assertions.assertEquals("pgylg", response.iterator().next().eventClass()); - Assertions.assertEquals("git", response.iterator().next().eventType()); - Assertions.assertEquals(1973221194, response.iterator().next().eventCount()); + Assertions.assertEquals("skzbb", response.iterator().next().deviceId()); + Assertions.assertEquals("dzumveekg", response.iterator().next().description()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-08T12:29:03Z"), + response.iterator().next().startTimestampUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-01T08:04:50Z"), + response.iterator().next().endTimestampUtc()); + Assertions.assertEquals("zuhkfpbsjyof", response.iterator().next().eventCategory()); + Assertions.assertEquals("xl", response.iterator().next().eventClass()); + Assertions.assertEquals("us", response.iterator().next().eventType()); + Assertions.assertEquals(1856979158, response.iterator().next().eventCount()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDevicesMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDevicesMockTests.java index cbd33be295984..77c223d9ca877 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDevicesMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListDevicesMockTests.java @@ -31,47 +31,27 @@ public void testListDevices() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"properties\":{\"deviceId\":\"ellwptfdy\",\"chipSku\":\"fqbuaceopzf\",\"lastAvailableOsVersion\":\"hhuao\",\"lastInstalledOsVersion\":\"pcqeqx\",\"lastOsUpdateUtc\":\"2021-02-19T08:33:13Z\",\"lastUpdateRequestUtc\":\"2021-12-05T23:59:55Z\",\"provisioningState\":\"Failed\"},\"id\":\"xcto\",\"name\":\"gbkdmoizpos\",\"type\":\"mgrcfbu\"}]}"; + String responseStr + = "{\"value\":[{\"properties\":{\"deviceId\":\"joya\",\"chipSku\":\"slyjpkiid\",\"lastAvailableOsVersion\":\"exznelixhnr\",\"lastInstalledOsVersion\":\"folhbnxknal\",\"lastOsUpdateUtc\":\"2021-06-16T03:28:56Z\",\"lastUpdateRequestUtc\":\"2021-05-05T13:18:41Z\",\"provisioningState\":\"Deleting\"},\"id\":\"tpnapnyiropuhpig\",\"name\":\"pgylg\",\"type\":\"git\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = - manager - .catalogs() - .listDevices( - "edjvcslynqw", - "ncw", - "zhxgktrmgucn", - 1295716293, - 994320059, - 47772472, - com.azure.core.util.Context.NONE); + PagedIterable response = manager.catalogs().listDevices("touwaboekqv", "elnsmvbxw", "jsflhhcaalnjix", + 923639125, 1143509001, 589324262, com.azure.core.util.Context.NONE); - Assertions.assertEquals("ellwptfdy", response.iterator().next().deviceId()); + Assertions.assertEquals("joya", response.iterator().next().properties().deviceId()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListMockTests.java index ed17d3f62a22c..8784e4046ca01 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CatalogsListMockTests.java @@ -31,38 +31,27 @@ public void testList() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\"},\"location\":\"kde\",\"tags\":{\"kdwzbaiuebbaumny\":\"vlopwiyighx\",\"txp\":\"upedeojnabckhs\",\"tfhvpesapskrdqmh\":\"ie\",\"tkncwsc\":\"jdhtldwkyzxu\"},\"id\":\"svlxotogtwrup\",\"name\":\"sx\",\"type\":\"nmic\"}]}"; + String responseStr + = "{\"value\":[{\"properties\":{\"tenantId\":\"nxdhbt\",\"provisioningState\":\"Provisioning\"},\"location\":\"ywpnvjt\",\"tags\":{\"abgy\":\"ermclfplphoxuscr\",\"qugxywpmueefjzwf\":\"psbjta\"},\"id\":\"kqujidsuyono\",\"name\":\"glaocq\",\"type\":\"tcc\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response = manager.catalogs().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("kde", response.iterator().next().location()); - Assertions.assertEquals("vlopwiyighx", response.iterator().next().tags().get("kdwzbaiuebbaumny")); + Assertions.assertEquals("ywpnvjt", response.iterator().next().location()); + Assertions.assertEquals("ermclfplphoxuscr", response.iterator().next().tags().get("abgy")); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateChainResponseInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateChainResponseInnerTests.java index 20eb83b8c343b..8f4a231aa5546 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateChainResponseInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateChainResponseInnerTests.java @@ -10,10 +10,8 @@ public final class CertificateChainResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CertificateChainResponseInner model = - BinaryData - .fromString("{\"certificateChain\":\"uskcqvkocrcj\"}") - .toObject(CertificateChainResponseInner.class); + CertificateChainResponseInner model + = BinaryData.fromString("{\"certificateChain\":\"cph\"}").toObject(CertificateChainResponseInner.class); } @org.junit.jupiter.api.Test diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateInnerTests.java index 6754027061f50..9b8b53b83170c 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateInnerTests.java @@ -6,20 +6,19 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.sphere.fluent.models.CertificateInner; +import com.azure.resourcemanager.sphere.models.CertificateProperties; public final class CertificateInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CertificateInner model = - BinaryData - .fromString( - "{\"properties\":{\"certificate\":\"eotusivyevc\",\"status\":\"Active\",\"subject\":\"hn\",\"thumbprint\":\"ngbwjz\",\"expiryUtc\":\"2020-12-28T13:19:57Z\",\"notBeforeUtc\":\"2021-11-04T09:44:48Z\",\"provisioningState\":\"Failed\"},\"id\":\"spemvtzfk\",\"name\":\"fublj\",\"type\":\"fxqeof\"}") - .toObject(CertificateInner.class); + CertificateInner model = BinaryData.fromString( + "{\"properties\":{\"certificate\":\"oc\",\"status\":\"Inactive\",\"subject\":\"blgphuticn\",\"thumbprint\":\"kao\",\"expiryUtc\":\"2021-10-08T07:48:08Z\",\"notBeforeUtc\":\"2021-02-22T11:39:16Z\",\"provisioningState\":\"Updating\"},\"id\":\"xhurok\",\"name\":\"tyxolniwpwc\",\"type\":\"kjfkg\"}") + .toObject(CertificateInner.class); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CertificateInner model = new CertificateInner(); + CertificateInner model = new CertificateInner().withProperties(new CertificateProperties()); model = BinaryData.fromObject(model).toObject(CertificateInner.class); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateListResultTests.java index 7446a0f2cf621..a0c05cbbd6f7a 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateListResultTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificateListResultTests.java @@ -7,25 +7,23 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.sphere.fluent.models.CertificateInner; import com.azure.resourcemanager.sphere.models.CertificateListResult; +import com.azure.resourcemanager.sphere.models.CertificateProperties; import java.util.Arrays; -import org.junit.jupiter.api.Assertions; public final class CertificateListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CertificateListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"certificate\":\"xxjtfe\",\"status\":\"Expired\",\"subject\":\"fziton\",\"thumbprint\":\"qfpjk\",\"expiryUtc\":\"2021-05-09T13:58:23Z\",\"notBeforeUtc\":\"2021-11-24T18:52:18Z\",\"provisioningState\":\"Failed\"},\"id\":\"hpf\",\"name\":\"xypininmayhuybbk\",\"type\":\"odepoogin\"}],\"nextLink\":\"amiheognarxz\"}") - .toObject(CertificateListResult.class); - Assertions.assertEquals("amiheognarxz", model.nextLink()); + CertificateListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"certificate\":\"v\",\"status\":\"Inactive\",\"subject\":\"ihnhun\",\"thumbprint\":\"wjzrnfygxgisp\",\"expiryUtc\":\"2021-05-03T11:09:18Z\",\"notBeforeUtc\":\"2021-01-12T09:11:57Z\",\"provisioningState\":\"Accepted\"},\"id\":\"fublj\",\"name\":\"fxqeof\",\"type\":\"aeqjhqjbasvms\"},{\"properties\":{\"certificate\":\"ulngsntn\",\"status\":\"Expired\",\"subject\":\"zgcwrw\",\"thumbprint\":\"xxwr\",\"expiryUtc\":\"2021-07-19T21:40:35Z\",\"notBeforeUtc\":\"2021-04-09T18:31:52Z\",\"provisioningState\":\"Canceled\"},\"id\":\"qvkoc\",\"name\":\"cjdkwtnhxbnjbi\",\"type\":\"sqrglssainq\"},{\"properties\":{\"certificate\":\"nzl\",\"status\":\"Inactive\",\"subject\":\"ppeebvmgxsab\",\"thumbprint\":\"qduujitcjczdz\",\"expiryUtc\":\"2021-11-12T14:41:45Z\",\"notBeforeUtc\":\"2021-05-08T08:52:13Z\",\"provisioningState\":\"Deleting\"},\"id\":\"pdappds\",\"name\":\"dkvwrwjfe\",\"type\":\"snhu\"}],\"nextLink\":\"eltmrldhugjzzdat\"}") + .toObject(CertificateListResult.class); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CertificateListResult model = - new CertificateListResult().withValue(Arrays.asList(new CertificateInner())).withNextLink("amiheognarxz"); + CertificateListResult model = new CertificateListResult() + .withValue(Arrays.asList(new CertificateInner().withProperties(new CertificateProperties()), + new CertificateInner().withProperties(new CertificateProperties()), + new CertificateInner().withProperties(new CertificateProperties()))); model = BinaryData.fromObject(model).toObject(CertificateListResult.class); - Assertions.assertEquals("amiheognarxz", model.nextLink()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatePropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatePropertiesTests.java index 466e9b7ffa5b1..c49965d7ba157 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatePropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatePropertiesTests.java @@ -5,16 +5,14 @@ package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.CertificateProperties; +import com.azure.resourcemanager.sphere.models.CertificateProperties; public final class CertificatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CertificateProperties model = - BinaryData - .fromString( - "{\"certificate\":\"e\",\"status\":\"Expired\",\"subject\":\"jbasvmsmjqulngs\",\"thumbprint\":\"nbybkzgcwrwcl\",\"expiryUtc\":\"2021-06-21T13:48:53Z\",\"notBeforeUtc\":\"2021-01-30T10:40:21Z\",\"provisioningState\":\"Canceled\"}") - .toObject(CertificateProperties.class); + CertificateProperties model = BinaryData.fromString( + "{\"certificate\":\"w\",\"status\":\"Revoked\",\"subject\":\"ypl\",\"thumbprint\":\"kbasyypn\",\"expiryUtc\":\"2021-11-02T07:55:59Z\",\"notBeforeUtc\":\"2021-11-25T20:26:44Z\",\"provisioningState\":\"Accepted\"}") + .toObject(CertificateProperties.class); } @org.junit.jupiter.api.Test diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesGetWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesGetWithResponseMockTests.java index c4b74f5c71434..5fb49d726ef15 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesGetWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesGetWithResponseMockTests.java @@ -29,39 +29,26 @@ public void testGetWithResponse() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"properties\":{\"certificate\":\"d\",\"status\":\"Inactive\",\"subject\":\"hzdxssadbzm\",\"thumbprint\":\"dfznudaodv\",\"expiryUtc\":\"2021-05-29T13:49:41Z\",\"notBeforeUtc\":\"2021-08-27T15:54:03Z\",\"provisioningState\":\"Provisioning\"},\"id\":\"lpstdbhhxsrzdz\",\"name\":\"cers\",\"type\":\"dntnevf\"}"; + String responseStr + = "{\"properties\":{\"certificate\":\"fthnzdn\",\"status\":\"Active\",\"subject\":\"nayqi\",\"thumbprint\":\"nduhavhqlkthum\",\"expiryUtc\":\"2021-08-13T06:24:50Z\",\"notBeforeUtc\":\"2021-04-19T22:18:17Z\",\"provisioningState\":\"Accepted\"},\"id\":\"duiertgcc\",\"name\":\"mvaolps\",\"type\":\"lqlfm\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + Certificate response = manager.certificates() + .getWithResponse("wqytjrybnwjewgdr", "ervnaenqpehi", "doy", com.azure.core.util.Context.NONE).getValue(); - Certificate response = - manager - .certificates() - .getWithResponse("aolps", "lqlfm", "dnbbglzps", com.azure.core.util.Context.NONE) - .getValue(); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesListByCatalogMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesListByCatalogMockTests.java index 046b9f5afd56d..6364826e8ec04 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesListByCatalogMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesListByCatalogMockTests.java @@ -30,45 +30,26 @@ public void testListByCatalog() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"properties\":{\"certificate\":\"n\",\"status\":\"Expired\",\"subject\":\"gdrjervnaenqpe\",\"thumbprint\":\"ndoygmifthnzdnd\",\"expiryUtc\":\"2021-07-04T07:51:31Z\",\"notBeforeUtc\":\"2021-07-27T07:40:17Z\",\"provisioningState\":\"Canceled\"},\"id\":\"gynduha\",\"name\":\"hqlkthumaqo\",\"type\":\"bgycduiertgccym\"}]}"; + String responseStr + = "{\"value\":[{\"properties\":{\"certificate\":\"uvwbhsqfs\",\"status\":\"Expired\",\"subject\":\"jbi\",\"thumbprint\":\"bpybsrfbjf\",\"expiryUtc\":\"2021-07-05T13:20:17Z\",\"notBeforeUtc\":\"2021-10-31T01:03:52Z\",\"provisioningState\":\"Updating\"},\"id\":\"tpvjzbexilzznfqq\",\"name\":\"vwpm\",\"type\":\"taruoujmkcj\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.certificates().listByCatalog("ytkblmpew", "wfbkrvrns", + "shqjohxcrsbf", 249445305, 1210534043, 1966093769, com.azure.core.util.Context.NONE); - PagedIterable response = - manager - .certificates() - .listByCatalog( - "otftpvjzbexilz", - "nfqqnvwp", - "qtaruoujmkcjhwq", - 1209878928, - 1656357002, - 75465955, - com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveCertChainWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveCertChainWithResponseMockTests.java index 29c0fee1fc770..5b3b5a8e49d28 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveCertChainWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveCertChainWithResponseMockTests.java @@ -29,38 +29,25 @@ public void testRetrieveCertChainWithResponse() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"certificateChain\":\"mweriofzpy\"}"; + String responseStr = "{\"certificateChain\":\"dvxzbncblylpst\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + CertificateChainResponse response = manager.certificates().retrieveCertChainWithResponse("dnbbglzps", + "iydmcwyhzdxs", "adbzmnvdfznud", com.azure.core.util.Context.NONE).getValue(); - CertificateChainResponse response = - manager - .certificates() - .retrieveCertChainWithResponse("wjmy", "tdss", "s", com.azure.core.util.Context.NONE) - .getValue(); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveProofOfPossessionNonceWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveProofOfPossessionNonceWithResponseMockTests.java index 012c89bb50ee5..7e21c84c01e39 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveProofOfPossessionNonceWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CertificatesRetrieveProofOfPossessionNonceWithResponseMockTests.java @@ -30,44 +30,29 @@ public void testRetrieveProofOfPossessionNonceWithResponse() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"certificate\":\"k\",\"status\":\"Inactive\",\"subject\":\"pjflcxogao\",\"thumbprint\":\"nzmnsikvm\",\"expiryUtc\":\"2021-05-13T18:51:38Z\",\"notBeforeUtc\":\"2021-02-18T23:34:18Z\",\"provisioningState\":\"Failed\"}"; + String responseStr + = "{\"certificate\":\"mweriofzpy\",\"status\":\"Inactive\",\"subject\":\"wab\",\"thumbprint\":\"tshhszhedp\",\"expiryUtc\":\"2021-10-13T23:51:57Z\",\"notBeforeUtc\":\"2021-09-12T04:45:44Z\",\"provisioningState\":\"Succeeded\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + ProofOfPossessionNonceResponse response = manager.certificates() + .retrieveProofOfPossessionNonceWithResponse("bhhxsrzdzuc", "rsc", "ntnev", + new ProofOfPossessionNonceRequest().withProofOfPossessionNonce("iwjmygtdssls"), + com.azure.core.util.Context.NONE) + .getValue(); - ProofOfPossessionNonceResponse response = - manager - .certificates() - .retrieveProofOfPossessionNonceWithResponse( - "semwabnet", - "hhszh", - "d", - new ProofOfPossessionNonceRequest().withProofOfPossessionNonce("lvwiwubmwmbesl"), - com.azure.core.util.Context.NONE) - .getValue(); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ClaimDevicesRequestTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ClaimDevicesRequestTests.java index 987e77431a939..157bd75444d16 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ClaimDevicesRequestTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ClaimDevicesRequestTests.java @@ -12,19 +12,16 @@ public final class ClaimDevicesRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ClaimDevicesRequest model = - BinaryData - .fromString("{\"deviceIdentifiers\":[\"ckzywbiexzfeyue\",\"xibxujwbhqwalm\",\"zyoxaepdkzjan\"]}") - .toObject(ClaimDevicesRequest.class); - Assertions.assertEquals("ckzywbiexzfeyue", model.deviceIdentifiers().get(0)); + ClaimDevicesRequest model = BinaryData.fromString("{\"deviceIdentifiers\":[\"wiyighxpkdw\",\"baiuebbaumny\"]}") + .toObject(ClaimDevicesRequest.class); + Assertions.assertEquals("wiyighxpkdw", model.deviceIdentifiers().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClaimDevicesRequest model = - new ClaimDevicesRequest() - .withDeviceIdentifiers(Arrays.asList("ckzywbiexzfeyue", "xibxujwbhqwalm", "zyoxaepdkzjan")); + ClaimDevicesRequest model + = new ClaimDevicesRequest().withDeviceIdentifiers(Arrays.asList("wiyighxpkdw", "baiuebbaumny")); model = BinaryData.fromObject(model).toObject(ClaimDevicesRequest.class); - Assertions.assertEquals("ckzywbiexzfeyue", model.deviceIdentifiers().get(0)); + Assertions.assertEquals("wiyighxpkdw", model.deviceIdentifiers().get(0)); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountDeviceResponseTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountDeviceResponseTests.java new file mode 100644 index 0000000000000..5b91fb03e7476 --- /dev/null +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountDeviceResponseTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.sphere.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.sphere.models.CountDeviceResponse; +import org.junit.jupiter.api.Assertions; + +public final class CountDeviceResponseTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CountDeviceResponse model = BinaryData.fromString("{\"value\":329870770}").toObject(CountDeviceResponse.class); + Assertions.assertEquals(329870770, model.value()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CountDeviceResponse model = new CountDeviceResponse().withValue(329870770); + model = BinaryData.fromObject(model).toObject(CountDeviceResponse.class); + Assertions.assertEquals(329870770, model.value()); + } +} diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountDeviceResponseInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountDevicesResponseInnerTests.java similarity index 56% rename from sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountDeviceResponseInnerTests.java rename to sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountDevicesResponseInnerTests.java index 2ffe088cd6d62..234ac109554c5 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountDeviceResponseInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountDevicesResponseInnerTests.java @@ -5,21 +5,21 @@ package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.CountDeviceResponseInner; +import com.azure.resourcemanager.sphere.fluent.models.CountDevicesResponseInner; import org.junit.jupiter.api.Assertions; -public final class CountDeviceResponseInnerTests { +public final class CountDevicesResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CountDeviceResponseInner model = - BinaryData.fromString("{\"value\":1762114496}").toObject(CountDeviceResponseInner.class); - Assertions.assertEquals(1762114496, model.value()); + CountDevicesResponseInner model + = BinaryData.fromString("{\"value\":1041920176}").toObject(CountDevicesResponseInner.class); + Assertions.assertEquals(1041920176, model.value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CountDeviceResponseInner model = new CountDeviceResponseInner().withValue(1762114496); - model = BinaryData.fromObject(model).toObject(CountDeviceResponseInner.class); - Assertions.assertEquals(1762114496, model.value()); + CountDevicesResponseInner model = new CountDevicesResponseInner().withValue(1041920176); + model = BinaryData.fromObject(model).toObject(CountDevicesResponseInner.class); + Assertions.assertEquals(1041920176, model.value()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountElementsResponseTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountElementsResponseTests.java index 41e3672f50df1..126ce4506c957 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountElementsResponseTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/CountElementsResponseTests.java @@ -11,15 +11,15 @@ public final class CountElementsResponseTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - CountElementsResponse model = - BinaryData.fromString("{\"value\":1742159588}").toObject(CountElementsResponse.class); - Assertions.assertEquals(1742159588, model.value()); + CountElementsResponse model + = BinaryData.fromString("{\"value\":494669618}").toObject(CountElementsResponse.class); + Assertions.assertEquals(494669618, model.value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CountElementsResponse model = new CountElementsResponse().withValue(1742159588); + CountElementsResponse model = new CountElementsResponse().withValue(494669618); model = BinaryData.fromObject(model).toObject(CountElementsResponse.class); - Assertions.assertEquals(1742159588, model.value()); + Assertions.assertEquals(494669618, model.value()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentInnerTests.java index 08bb9bfd280b6..b234299ca4c30 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentInnerTests.java @@ -7,6 +7,8 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.sphere.fluent.models.DeploymentInner; import com.azure.resourcemanager.sphere.fluent.models.ImageInner; +import com.azure.resourcemanager.sphere.models.DeploymentProperties; +import com.azure.resourcemanager.sphere.models.ImageProperties; import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -14,45 +16,34 @@ public final class DeploymentInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DeploymentInner model = - BinaryData - .fromString( - "{\"properties\":{\"deploymentId\":\"jrmvdjwzrlo\",\"deployedImages\":[{\"properties\":{\"image\":\"hijco\",\"imageId\":\"ctbzaq\",\"imageName\":\"sycbkbfk\",\"regionalDataBoundary\":\"None\",\"uri\":\"kexxppof\",\"description\":\"axcfjpgddtocjjx\",\"componentId\":\"pmouexhdz\",\"imageType\":\"InvalidImageType\",\"provisioningState\":\"Accepted\"},\"id\":\"ojnxqbzvdd\",\"name\":\"t\",\"type\":\"ndei\"},{\"properties\":{\"image\":\"w\",\"imageId\":\"zao\",\"imageName\":\"uhrhcffcyddgl\",\"regionalDataBoundary\":\"None\",\"uri\":\"jqkwpyeicx\",\"description\":\"ciwqvhk\",\"componentId\":\"xuigdtopbobj\",\"imageType\":\"ManifestSet\",\"provisioningState\":\"Deleting\"},\"id\":\"w\",\"name\":\"a\",\"type\":\"a\"},{\"properties\":{\"image\":\"z\",\"imageId\":\"vvtpgvdfgio\",\"imageName\":\"ftutqxlngxlefgu\",\"regionalDataBoundary\":\"None\",\"uri\":\"rxdq\",\"description\":\"dt\",\"componentId\":\"zrvqdr\",\"imageType\":\"NormalWorldKernel\",\"provisioningState\":\"Provisioning\"},\"id\":\"big\",\"name\":\"h\",\"type\":\"qfbow\"},{\"properties\":{\"image\":\"nyktzlcuiy\",\"imageId\":\"qyw\",\"imageName\":\"drvyn\",\"regionalDataBoundary\":\"EU\",\"uri\":\"phrcgyncoc\",\"description\":\"cfvmmco\",\"componentId\":\"sxlzevgbmqj\",\"imageType\":\"PlutonRuntime\",\"provisioningState\":\"Deleting\"},\"id\":\"pmivkwlzu\",\"name\":\"ccfwnfnbacfion\",\"type\":\"ebxetqgtzxdp\"}],\"deploymentDateUtc\":\"2021-04-08T18:16:48Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"wxrjfeallnwsub\",\"name\":\"snjampmng\",\"type\":\"zscxaqwo\"}") - .toObject(DeploymentInner.class); - Assertions.assertEquals("jrmvdjwzrlo", model.deploymentId()); - Assertions.assertEquals("hijco", model.deployedImages().get(0).image()); - Assertions.assertEquals("ctbzaq", model.deployedImages().get(0).imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.deployedImages().get(0).regionalDataBoundary()); + DeploymentInner model = BinaryData.fromString( + "{\"properties\":{\"deploymentId\":\"jrmvdjwzrlo\",\"deployedImages\":[{\"properties\":{\"image\":\"hijco\",\"imageId\":\"ctbzaq\",\"imageName\":\"sycbkbfk\",\"regionalDataBoundary\":\"None\",\"uri\":\"kexxppof\",\"description\":\"axcfjpgddtocjjx\",\"componentId\":\"pmouexhdz\",\"imageType\":\"InvalidImageType\",\"provisioningState\":\"Accepted\"},\"id\":\"jnxqbzvddntwn\",\"name\":\"eic\",\"type\":\"twnpzaoqvuhrhcf\"},{\"properties\":{\"image\":\"ddglm\",\"imageId\":\"hjq\",\"imageName\":\"pyeicxm\",\"regionalDataBoundary\":\"None\",\"uri\":\"q\",\"description\":\"khixuigdtopbo\",\"componentId\":\"og\",\"imageType\":\"InvalidImageType\",\"provisioningState\":\"Deleting\"},\"id\":\"m\",\"name\":\"uhrzayvvt\",\"type\":\"gvdfgiotkftutq\"},{\"properties\":{\"image\":\"gxlefgugnxkrxd\",\"imageId\":\"i\",\"imageName\":\"thz\",\"regionalDataBoundary\":\"EU\",\"uri\":\"rabhjybigeho\",\"description\":\"bowsk\",\"componentId\":\"yktz\",\"imageType\":\"SecurityMonitor\",\"provisioningState\":\"Provisioning\"},\"id\":\"gqywgndrv\",\"name\":\"nhzgpphrcgyn\",\"type\":\"ocpecfvmmco\"},{\"properties\":{\"image\":\"xlzevgbmqjqabcy\",\"imageId\":\"ivkwlzuvccfwnfnb\",\"imageName\":\"fionl\",\"regionalDataBoundary\":\"None\",\"uri\":\"tqgtzxdpnqbqq\",\"description\":\"rjfeallnwsubisnj\",\"componentId\":\"pmng\",\"imageType\":\"FwConfig\",\"provisioningState\":\"Provisioning\"},\"id\":\"qwoochcbon\",\"name\":\"vpk\",\"type\":\"lrxnjeaseiphe\"}],\"deploymentDateUtc\":\"2021-04-05T14:36:27Z\",\"provisioningState\":\"Failed\"},\"id\":\"yyien\",\"name\":\"bdlwtgrhpdjpj\",\"type\":\"masxazjpqyegu\"}") + .toObject(DeploymentInner.class); + Assertions.assertEquals("jrmvdjwzrlo", model.properties().deploymentId()); + Assertions.assertEquals("hijco", model.properties().deployedImages().get(0).properties().image()); + Assertions.assertEquals("ctbzaq", model.properties().deployedImages().get(0).properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.NONE, + model.properties().deployedImages().get(0).properties().regionalDataBoundary()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeploymentInner model = - new DeploymentInner() - .withDeploymentId("jrmvdjwzrlo") - .withDeployedImages( - Arrays - .asList( - new ImageInner() - .withImage("hijco") - .withImageId("ctbzaq") - .withRegionalDataBoundary(RegionalDataBoundary.NONE), - new ImageInner() - .withImage("w") - .withImageId("zao") - .withRegionalDataBoundary(RegionalDataBoundary.NONE), - new ImageInner() - .withImage("z") - .withImageId("vvtpgvdfgio") - .withRegionalDataBoundary(RegionalDataBoundary.NONE), - new ImageInner() - .withImage("nyktzlcuiy") - .withImageId("qyw") - .withRegionalDataBoundary(RegionalDataBoundary.EU))); + DeploymentInner model + = new DeploymentInner().withProperties(new DeploymentProperties().withDeploymentId("jrmvdjwzrlo") + .withDeployedImages(Arrays.asList( + new ImageInner().withProperties(new ImageProperties().withImage("hijco").withImageId("ctbzaq") + .withRegionalDataBoundary(RegionalDataBoundary.NONE)), + new ImageInner().withProperties(new ImageProperties().withImage("ddglm").withImageId("hjq") + .withRegionalDataBoundary(RegionalDataBoundary.NONE)), + new ImageInner().withProperties(new ImageProperties().withImage("gxlefgugnxkrxd").withImageId("i") + .withRegionalDataBoundary(RegionalDataBoundary.EU)), + new ImageInner().withProperties(new ImageProperties().withImage("xlzevgbmqjqabcy") + .withImageId("ivkwlzuvccfwnfnb").withRegionalDataBoundary(RegionalDataBoundary.NONE))))); model = BinaryData.fromObject(model).toObject(DeploymentInner.class); - Assertions.assertEquals("jrmvdjwzrlo", model.deploymentId()); - Assertions.assertEquals("hijco", model.deployedImages().get(0).image()); - Assertions.assertEquals("ctbzaq", model.deployedImages().get(0).imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.deployedImages().get(0).regionalDataBoundary()); + Assertions.assertEquals("jrmvdjwzrlo", model.properties().deploymentId()); + Assertions.assertEquals("hijco", model.properties().deployedImages().get(0).properties().image()); + Assertions.assertEquals("ctbzaq", model.properties().deployedImages().get(0).properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.NONE, + model.properties().deployedImages().get(0).properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentListResultTests.java index 6fee8c609012e..eb6600f03f0d0 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentListResultTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentListResultTests.java @@ -8,40 +8,26 @@ import com.azure.resourcemanager.sphere.fluent.models.DeploymentInner; import com.azure.resourcemanager.sphere.fluent.models.ImageInner; import com.azure.resourcemanager.sphere.models.DeploymentListResult; +import com.azure.resourcemanager.sphere.models.DeploymentProperties; +import com.azure.resourcemanager.sphere.models.ImageProperties; import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class DeploymentListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DeploymentListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"deploymentId\":\"idnsezcxtb\",\"deployedImages\":[{\"properties\":{},\"id\":\"yc\",\"name\":\"sne\",\"type\":\"mdwzjeiachboo\"},{\"properties\":{},\"id\":\"lnrosfqp\",\"name\":\"eeh\",\"type\":\"zvypyqrimzinp\"}],\"deploymentDateUtc\":\"2021-01-25T11:13:44Z\",\"provisioningState\":\"Deleting\"},\"id\":\"kirsoodqxhc\",\"name\":\"mnoh\",\"type\":\"t\"},{\"properties\":{\"deploymentId\":\"h\",\"deployedImages\":[{\"properties\":{},\"id\":\"fiyipjxsqwpgrj\",\"name\":\"znorcj\",\"type\":\"vsnb\"},{\"properties\":{},\"id\":\"qabnmoc\",\"name\":\"cyshurzafbljjgp\",\"type\":\"toqcjmklja\"},{\"properties\":{},\"id\":\"qidtqajzyu\",\"name\":\"pku\",\"type\":\"jkrlkhbzhfepg\"},{\"properties\":{},\"id\":\"qex\",\"name\":\"locx\",\"type\":\"c\"}],\"deploymentDateUtc\":\"2021-01-04T21:09:36Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"hhbcsglummajtjao\",\"name\":\"xobnbdxkqpxok\",\"type\":\"jionpimexgstxgc\"}],\"nextLink\":\"dg\"}") - .toObject(DeploymentListResult.class); - Assertions.assertEquals("idnsezcxtb", model.value().get(0).deploymentId()); - Assertions.assertEquals("dg", model.nextLink()); + DeploymentListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"deploymentId\":\"jmkljavbqidtqajz\",\"deployedImages\":[{\"properties\":{},\"id\":\"u\",\"name\":\"jkrlkhbzhfepg\",\"type\":\"gqexzlocxs\"}],\"deploymentDateUtc\":\"2021-11-18T07:05:01Z\",\"provisioningState\":\"Canceled\"},\"id\":\"hhbcsglummajtjao\",\"name\":\"xobnbdxkqpxok\",\"type\":\"jionpimexgstxgc\"}],\"nextLink\":\"dg\"}") + .toObject(DeploymentListResult.class); + Assertions.assertEquals("jmkljavbqidtqajz", model.value().get(0).properties().deploymentId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeploymentListResult model = - new DeploymentListResult() - .withValue( - Arrays - .asList( - new DeploymentInner() - .withDeploymentId("idnsezcxtb") - .withDeployedImages(Arrays.asList(new ImageInner(), new ImageInner())), - new DeploymentInner() - .withDeploymentId("h") - .withDeployedImages( - Arrays - .asList( - new ImageInner(), new ImageInner(), new ImageInner(), new ImageInner())))) - .withNextLink("dg"); + DeploymentListResult model = new DeploymentListResult().withValue(Arrays + .asList(new DeploymentInner().withProperties(new DeploymentProperties().withDeploymentId("jmkljavbqidtqajz") + .withDeployedImages(Arrays.asList(new ImageInner().withProperties(new ImageProperties())))))); model = BinaryData.fromObject(model).toObject(DeploymentListResult.class); - Assertions.assertEquals("idnsezcxtb", model.value().get(0).deploymentId()); - Assertions.assertEquals("dg", model.nextLink()); + Assertions.assertEquals("jmkljavbqidtqajz", model.value().get(0).properties().deploymentId()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentPropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentPropertiesTests.java index 7073c470e6569..4a33e1481043c 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentPropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentPropertiesTests.java @@ -5,8 +5,9 @@ package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeploymentProperties; import com.azure.resourcemanager.sphere.fluent.models.ImageInner; +import com.azure.resourcemanager.sphere.models.DeploymentProperties; +import com.azure.resourcemanager.sphere.models.ImageProperties; import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -14,37 +15,29 @@ public final class DeploymentPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DeploymentProperties model = - BinaryData - .fromString( - "{\"deploymentId\":\"hcbonqvpkvlr\",\"deployedImages\":[{\"properties\":{\"image\":\"seiphe\",\"imageId\":\"lokeyy\",\"imageName\":\"nj\",\"regionalDataBoundary\":\"EU\",\"uri\":\"tgrhpdjpjumas\",\"description\":\"zj\",\"componentId\":\"yegu\",\"imageType\":\"FirmwareUpdateManifest\",\"provisioningState\":\"Provisioning\"},\"id\":\"xhejjzzvdud\",\"name\":\"wdslfhotwmcy\",\"type\":\"pwlbjnpg\"},{\"properties\":{\"image\":\"tadehxnltyfsopp\",\"imageId\":\"uesnzwdejbavo\",\"imageName\":\"zdmohctbqvu\",\"regionalDataBoundary\":\"None\",\"uri\":\"ndnvo\",\"description\":\"ujjugwdkcglh\",\"componentId\":\"azjdyggd\",\"imageType\":\"WifiFirmware\",\"provisioningState\":\"Provisioning\"},\"id\":\"b\",\"name\":\"uofqwe\",\"type\":\"kh\"}],\"deploymentDateUtc\":\"2021-06-19T17:30:56Z\",\"provisioningState\":\"Succeeded\"}") - .toObject(DeploymentProperties.class); - Assertions.assertEquals("hcbonqvpkvlr", model.deploymentId()); - Assertions.assertEquals("seiphe", model.deployedImages().get(0).image()); - Assertions.assertEquals("lokeyy", model.deployedImages().get(0).imageId()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.deployedImages().get(0).regionalDataBoundary()); + DeploymentProperties model = BinaryData.fromString( + "{\"deploymentId\":\"hb\",\"deployedImages\":[{\"properties\":{\"image\":\"jzzvdud\",\"imageId\":\"dslfhotwmcy\",\"imageName\":\"wlbjnpgacftade\",\"regionalDataBoundary\":\"EU\",\"uri\":\"tyfsoppusuesn\",\"description\":\"dejbavo\",\"componentId\":\"zdmohctbqvu\",\"imageType\":\"BaseSystemUpdateManifest\",\"provisioningState\":\"Canceled\"},\"id\":\"nvowgujju\",\"name\":\"wdkcglhsl\",\"type\":\"zj\"},{\"properties\":{\"image\":\"gdtjixhbkuofqwey\",\"imageId\":\"menevfyexfwh\",\"imageName\":\"cibvyvdcsitynn\",\"regionalDataBoundary\":\"EU\",\"uri\":\"ectehf\",\"description\":\"scjeypv\",\"componentId\":\"zrkgqhcjrefovg\",\"imageType\":\"CustomerBoardConfig\",\"provisioningState\":\"Succeeded\"},\"id\":\"yyvxyqjpkcattpn\",\"name\":\"jcrcczsqpjhvmda\",\"type\":\"v\"}],\"deploymentDateUtc\":\"2021-09-30T19:57Z\",\"provisioningState\":\"Failed\"}") + .toObject(DeploymentProperties.class); + Assertions.assertEquals("hb", model.deploymentId()); + Assertions.assertEquals("jzzvdud", model.deployedImages().get(0).properties().image()); + Assertions.assertEquals("dslfhotwmcy", model.deployedImages().get(0).properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.EU, + model.deployedImages().get(0).properties().regionalDataBoundary()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeploymentProperties model = - new DeploymentProperties() - .withDeploymentId("hcbonqvpkvlr") - .withDeployedImages( - Arrays - .asList( - new ImageInner() - .withImage("seiphe") - .withImageId("lokeyy") - .withRegionalDataBoundary(RegionalDataBoundary.EU), - new ImageInner() - .withImage("tadehxnltyfsopp") - .withImageId("uesnzwdejbavo") - .withRegionalDataBoundary(RegionalDataBoundary.NONE))); + DeploymentProperties model = new DeploymentProperties().withDeploymentId("hb") + .withDeployedImages(Arrays.asList( + new ImageInner().withProperties(new ImageProperties().withImage("jzzvdud").withImageId("dslfhotwmcy") + .withRegionalDataBoundary(RegionalDataBoundary.EU)), + new ImageInner().withProperties(new ImageProperties().withImage("gdtjixhbkuofqwey") + .withImageId("menevfyexfwh").withRegionalDataBoundary(RegionalDataBoundary.EU)))); model = BinaryData.fromObject(model).toObject(DeploymentProperties.class); - Assertions.assertEquals("hcbonqvpkvlr", model.deploymentId()); - Assertions.assertEquals("seiphe", model.deployedImages().get(0).image()); - Assertions.assertEquals("lokeyy", model.deployedImages().get(0).imageId()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.deployedImages().get(0).regionalDataBoundary()); + Assertions.assertEquals("hb", model.deploymentId()); + Assertions.assertEquals("jzzvdud", model.deployedImages().get(0).properties().image()); + Assertions.assertEquals("dslfhotwmcy", model.deployedImages().get(0).properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.EU, + model.deployedImages().get(0).properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsCreateOrUpdateMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsCreateOrUpdateMockTests.java index 3341621f04508..782435cedb3dd 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsCreateOrUpdateMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsCreateOrUpdateMockTests.java @@ -14,6 +14,8 @@ import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.fluent.models.ImageInner; import com.azure.resourcemanager.sphere.models.Deployment; +import com.azure.resourcemanager.sphere.models.DeploymentProperties; +import com.azure.resourcemanager.sphere.models.ImageProperties; import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; @@ -33,57 +35,38 @@ public void testCreateOrUpdate() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"properties\":{\"deploymentId\":\"dsrezpdrhneuyow\",\"deployedImages\":[{\"properties\":{\"image\":\"t\",\"imageId\":\"ib\",\"imageName\":\"cgpik\",\"regionalDataBoundary\":\"None\",\"uri\":\"ejzanlfz\",\"description\":\"av\",\"componentId\":\"bzonok\",\"imageType\":\"FirmwareUpdateManifest\",\"provisioningState\":\"Deleting\"},\"id\":\"cirgzp\",\"name\":\"rlazszrnw\",\"type\":\"iin\"}],\"deploymentDateUtc\":\"2021-01-06T22:30:17Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"jylwbtlhflsj\",\"name\":\"dhszfjv\",\"type\":\"bgofeljag\"}"; + String responseStr + = "{\"properties\":{\"deploymentId\":\"wib\",\"deployedImages\":[{\"properties\":{\"image\":\"bhshfwpracstwity\",\"imageId\":\"evxccedcp\",\"imageName\":\"dyodnwzxltj\",\"regionalDataBoundary\":\"EU\",\"uri\":\"ltiugcxnavv\",\"description\":\"qiby\",\"componentId\":\"nyowxwlmdjrkvfg\",\"imageType\":\"FwConfig\",\"provisioningState\":\"Updating\"},\"id\":\"bodacizsjq\",\"name\":\"hkr\",\"type\":\"ibdeibq\"}],\"deploymentDateUtc\":\"2021-10-05T18:29:09Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"vxndz\",\"name\":\"mkrefajpjorwkq\",\"type\":\"yhgbijtjivfx\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Deployment response = - manager - .deployments() - .define("nmdyodnwzxl") - .withExistingDeviceGroup("dl", "h", "hfwpracstwit", "khevxccedc") - .withDeploymentId("vnhltiugcx") - .withDeployedImages( - Arrays - .asList( - new ImageInner() - .withImage("xqi") - .withImageId("qunyowxwlmdjr") - .withRegionalDataBoundary(RegionalDataBoundary.EU), - new ImageInner() - .withImage("jivfxzsjabib") - .withImageId("stawfsdjpvkv") - .withRegionalDataBoundary(RegionalDataBoundary.NONE))) - .create(); + Deployment response = manager.deployments().define("wpusdsttwvogv") + .withExistingDeviceGroup("bykutw", "fhpagmhrskdsnf", "sd", "akgtdlmkkzevdlh") + .withProperties(new DeploymentProperties().withDeploymentId("jdcngqqm") + .withDeployedImages(Arrays.asList( + new ImageInner().withProperties(new ImageProperties().withImage("gm").withImageId("rwr") + .withRegionalDataBoundary(RegionalDataBoundary.NONE)), + new ImageInner().withProperties(new ImageProperties().withImage("kaivwit").withImageId("cywuggwol") + .withRegionalDataBoundary(RegionalDataBoundary.EU))))) + .create(); - Assertions.assertEquals("dsrezpdrhneuyow", response.deploymentId()); - Assertions.assertEquals("t", response.deployedImages().get(0).image()); - Assertions.assertEquals("ib", response.deployedImages().get(0).imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, response.deployedImages().get(0).regionalDataBoundary()); + Assertions.assertEquals("wib", response.properties().deploymentId()); + Assertions.assertEquals("bhshfwpracstwity", response.properties().deployedImages().get(0).properties().image()); + Assertions.assertEquals("evxccedcp", response.properties().deployedImages().get(0).properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.EU, + response.properties().deployedImages().get(0).properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsDeleteMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsDeleteMockTests.java index 4ce227f68739a..6513e5ba1bb55 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsDeleteMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsDeleteMockTests.java @@ -32,30 +32,21 @@ public void testDelete() throws Exception { Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.deployments().delete("lolp", "vk", "r", "qvujzraehtwdwrf", "swibyr", com.azure.core.util.Context.NONE); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.deployments().delete("toego", "dwbwhkszzcmrvexz", "vbtqgsfraoyzk", "owtlmnguxawqald", + "yuuximerqfobwyzn", com.azure.core.util.Context.NONE); + } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsGetWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsGetWithResponseMockTests.java index 068679d45e304..27a15bb56030e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsGetWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsGetWithResponseMockTests.java @@ -31,45 +31,31 @@ public void testGetWithResponse() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"properties\":{\"deploymentId\":\"doamciodhkha\",\"deployedImages\":[{\"properties\":{\"image\":\"zbonlwnt\",\"imageId\":\"gokdwbwhks\",\"imageName\":\"cmrvexzt\",\"regionalDataBoundary\":\"None\",\"uri\":\"gsfraoyzkoow\",\"description\":\"mnguxawqaldsyu\",\"componentId\":\"imerqfobwyznk\",\"imageType\":\"InvalidImageType\",\"provisioningState\":\"Updating\"},\"id\":\"wpfhpagmhrskd\",\"name\":\"nfd\",\"type\":\"doakgtdlmkkzevdl\"},{\"properties\":{\"image\":\"pusdstt\",\"imageId\":\"ogvbbejdcngq\",\"imageName\":\"oakufgm\",\"regionalDataBoundary\":\"None\",\"uri\":\"rdgrtw\",\"description\":\"nuuzkopbm\",\"componentId\":\"rfdwoyu\",\"imageType\":\"Nwfs\",\"provisioningState\":\"Failed\"},\"id\":\"iefozbhdmsml\",\"name\":\"zqhof\",\"type\":\"rmaequ\"},{\"properties\":{\"image\":\"xicslfao\",\"imageId\":\"piyylhalnswhccsp\",\"imageName\":\"aivwitqscywu\",\"regionalDataBoundary\":\"EU\",\"uri\":\"luhczbw\",\"description\":\"hairsbrgzdwms\",\"componentId\":\"ypqwdxggiccc\",\"imageType\":\"RecoveryManifest\",\"provisioningState\":\"Succeeded\"},\"id\":\"exmk\",\"name\":\"tlstvlzywem\",\"type\":\"zrncsdt\"}],\"deploymentDateUtc\":\"2021-07-01T02:09:13Z\",\"provisioningState\":\"Deleting\"},\"id\":\"ypbsfgytguslfead\",\"name\":\"ygqukyhejh\",\"type\":\"isxgfp\"}"; + String responseStr + = "{\"properties\":{\"deploymentId\":\"qdpfuvglsbjjca\",\"deployedImages\":[{\"properties\":{\"image\":\"t\",\"imageId\":\"dut\",\"imageName\":\"ormrlxqtvcofudfl\",\"regionalDataBoundary\":\"None\",\"uri\":\"u\",\"description\":\"dknnqvsazn\",\"componentId\":\"tor\",\"imageType\":\"Policy\",\"provisioningState\":\"Succeeded\"},\"id\":\"hmk\",\"name\":\"c\",\"type\":\"rauwjuetaebu\"},{\"properties\":{\"image\":\"dmovsm\",\"imageId\":\"xwabmqoe\",\"imageName\":\"ifrvtpu\",\"regionalDataBoundary\":\"None\",\"uri\":\"qlgkfbtn\",\"description\":\"aongbj\",\"componentId\":\"tujitcjedft\",\"imageType\":\"BaseSystemUpdateManifest\",\"provisioningState\":\"Updating\"},\"id\":\"ojvdcpzfoqo\",\"name\":\"i\",\"type\":\"ybxarzgszu\"}],\"deploymentDateUtc\":\"2021-07-26T12:22:12Z\",\"provisioningState\":\"Canceled\"},\"id\":\"opidoamciodh\",\"name\":\"haz\",\"type\":\"khnzbonlw\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Deployment response = - manager - .deployments() - .getWithResponse( - "bjcntujitc", "ed", "twwaezkojvdcpzf", "qouicybxarzgsz", "foxciq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("doamciodhkha", response.deploymentId()); - Assertions.assertEquals("zbonlwnt", response.deployedImages().get(0).image()); - Assertions.assertEquals("gokdwbwhks", response.deployedImages().get(0).imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, response.deployedImages().get(0).regionalDataBoundary()); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + Deployment response = manager.deployments().getWithResponse("cckwyfzqwhxxbu", "qa", "zfeqztppri", + "lxorjaltolmncws", "bqwcsdbnwdcf", com.azure.core.util.Context.NONE).getValue(); + + Assertions.assertEquals("qdpfuvglsbjjca", response.properties().deploymentId()); + Assertions.assertEquals("t", response.properties().deployedImages().get(0).properties().image()); + Assertions.assertEquals("dut", response.properties().deployedImages().get(0).properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.NONE, + response.properties().deployedImages().get(0).properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsListByDeviceGroupMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsListByDeviceGroupMockTests.java index 861f00dbdfdfa..f0e6d9472c68a 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsListByDeviceGroupMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeploymentsListByDeviceGroupMockTests.java @@ -32,54 +32,33 @@ public void testListByDeviceGroup() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"properties\":{\"deploymentId\":\"rx\",\"deployedImages\":[{\"properties\":{\"image\":\"vaytdwkqbrq\",\"imageId\":\"paxh\",\"imageName\":\"iilivpdtiirqtd\",\"regionalDataBoundary\":\"EU\",\"uri\":\"oruzfgsquyfxrxx\",\"description\":\"ptramxj\",\"componentId\":\"wlwnwxuqlcv\",\"imageType\":\"UpdateCertStore\",\"provisioningState\":\"Failed\"},\"id\":\"tdooaoj\",\"name\":\"niodkooeb\",\"type\":\"nuj\"},{\"properties\":{\"image\":\"msbvdkcrodtjinf\",\"imageId\":\"lfltka\",\"imageName\":\"vefkdlfoakggk\",\"regionalDataBoundary\":\"EU\",\"uri\":\"ao\",\"description\":\"ulpqblylsyxkqjn\",\"componentId\":\"ervtiagxs\",\"imageType\":\"SecurityMonitor\",\"provisioningState\":\"Accepted\"},\"id\":\"mpsbzkfzbeyv\",\"name\":\"nqicvinvkjjxdxrb\",\"type\":\"ukzclewyhmlwpaz\"},{\"properties\":{\"image\":\"ofncckwyfzqwhxxb\",\"imageId\":\"qa\",\"imageName\":\"feqztppriol\",\"regionalDataBoundary\":\"EU\",\"uri\":\"altol\",\"description\":\"cwsobqwcs\",\"componentId\":\"nwdcfhu\",\"imageType\":\"PlutonRuntime\",\"provisioningState\":\"Updating\"},\"id\":\"uvglsbjjcanvx\",\"name\":\"vtvudutncormr\",\"type\":\"xqtvcofu\"},{\"properties\":{\"image\":\"vkg\",\"imageId\":\"bgdknnqv\",\"imageName\":\"znqntoru\",\"regionalDataBoundary\":\"EU\",\"uri\":\"a\",\"description\":\"kycgrauwj\",\"componentId\":\"taeburuvdm\",\"imageType\":\"NormalWorldKernel\",\"provisioningState\":\"Provisioning\"},\"id\":\"l\",\"name\":\"wabm\",\"type\":\"oefki\"}],\"deploymentDateUtc\":\"2021-07-14T12:33:43Z\",\"provisioningState\":\"Canceled\"},\"id\":\"u\",\"name\":\"ujmqlgkfbtndoa\",\"type\":\"n\"}]}"; + String responseStr + = "{\"value\":[{\"properties\":{\"deploymentId\":\"wmewzsyy\",\"deployedImages\":[{\"properties\":{\"image\":\"oibjudpfrxtrthz\",\"imageId\":\"ytdw\",\"imageName\":\"brqubp\",\"regionalDataBoundary\":\"None\",\"uri\":\"xiilivpdtiirqt\",\"description\":\"oaxoruzfgsqu\",\"componentId\":\"xrxxlep\",\"imageType\":\"OneBl\",\"provisioningState\":\"Deleting\"},\"id\":\"ezw\",\"name\":\"wnwxuqlcvyd\",\"type\":\"patdooaojkniodko\"},{\"properties\":{\"image\":\"wnujhemmsbvdk\",\"imageId\":\"odtji\",\"imageName\":\"wj\",\"regionalDataBoundary\":\"None\",\"uri\":\"kacjvefkdlfo\",\"description\":\"ggkfpagaowpul\",\"componentId\":\"blylsyxkqjnsj\",\"imageType\":\"UpdateCertStore\",\"provisioningState\":\"Succeeded\"},\"id\":\"gxsds\",\"name\":\"uem\",\"type\":\"sbzkf\"}],\"deploymentDateUtc\":\"2021-06-16T01:14:17Z\",\"provisioningState\":\"Failed\"},\"id\":\"nqicvinvkjjxdxrb\",\"name\":\"ukzclewyhmlwpaz\",\"type\":\"zpof\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = - manager - .deployments() - .listByDeviceGroup( - "nbyxbaaabjyv", - "yffimrzrtuzqogs", - "xnevfdnwn", - "mewzsyyc", - "uzsoi", - 2025880638, - 414197490, - 2135802257, - com.azure.core.util.Context.NONE); + PagedIterable response = manager.deployments().listByDeviceGroup("cqqudf", "byxbaaabjy", "ayffim", + "zrtuzq", "gsexne", 850324011, 779817958, 1536688095, com.azure.core.util.Context.NONE); - Assertions.assertEquals("rx", response.iterator().next().deploymentId()); - Assertions.assertEquals("vaytdwkqbrq", response.iterator().next().deployedImages().get(0).image()); - Assertions.assertEquals("paxh", response.iterator().next().deployedImages().get(0).imageId()); - Assertions - .assertEquals( - RegionalDataBoundary.EU, response.iterator().next().deployedImages().get(0).regionalDataBoundary()); + Assertions.assertEquals("wmewzsyy", response.iterator().next().properties().deploymentId()); + Assertions.assertEquals("oibjudpfrxtrthz", + response.iterator().next().properties().deployedImages().get(0).properties().image()); + Assertions.assertEquals("ytdw", + response.iterator().next().properties().deployedImages().get(0).properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.NONE, + response.iterator().next().properties().deployedImages().get(0).properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupInnerTests.java index 3c7b0effbe192..514635a5b1798 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupInnerTests.java @@ -7,6 +7,7 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner; import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; +import com.azure.resourcemanager.sphere.models.DeviceGroupProperties; import com.azure.resourcemanager.sphere.models.OSFeedType; import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; import com.azure.resourcemanager.sphere.models.UpdatePolicy; @@ -15,32 +16,27 @@ public final class DeviceGroupInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DeviceGroupInner model = - BinaryData - .fromString( - "{\"properties\":{\"description\":\"hqyudxorrqnbpoc\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":true,\"provisioningState\":\"Succeeded\"},\"id\":\"llr\",\"name\":\"vvdfwatkpnpul\",\"type\":\"xxbczwtr\"}") - .toObject(DeviceGroupInner.class); - Assertions.assertEquals("hqyudxorrqnbpoc", model.description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.regionalDataBoundary()); + DeviceGroupInner model = BinaryData.fromString( + "{\"properties\":{\"description\":\"d\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":true,\"provisioningState\":\"Canceled\"},\"id\":\"czwtruwiqzbqjv\",\"name\":\"ovm\",\"type\":\"okacspk\"}") + .toObject(DeviceGroupInner.class); + Assertions.assertEquals("d", model.properties().description()); + Assertions.assertEquals(OSFeedType.RETAIL, model.properties().osFeedType()); + Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.properties().updatePolicy()); + Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, model.properties().allowCrashDumpsCollection()); + Assertions.assertEquals(RegionalDataBoundary.EU, model.properties().regionalDataBoundary()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeviceGroupInner model = - new DeviceGroupInner() - .withDescription("hqyudxorrqnbpoc") - .withOsFeedType(OSFeedType.RETAIL_EVAL) - .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) - .withRegionalDataBoundary(RegionalDataBoundary.NONE); + DeviceGroupInner model = new DeviceGroupInner().withProperties(new DeviceGroupProperties().withDescription("d") + .withOsFeedType(OSFeedType.RETAIL).withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) + .withAllowCrashDumpsCollection(AllowCrashDumpCollection.ENABLED) + .withRegionalDataBoundary(RegionalDataBoundary.EU)); model = BinaryData.fromObject(model).toObject(DeviceGroupInner.class); - Assertions.assertEquals("hqyudxorrqnbpoc", model.description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.regionalDataBoundary()); + Assertions.assertEquals("d", model.properties().description()); + Assertions.assertEquals(OSFeedType.RETAIL, model.properties().osFeedType()); + Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.properties().updatePolicy()); + Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, model.properties().allowCrashDumpsCollection()); + Assertions.assertEquals(RegionalDataBoundary.EU, model.properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupListResultTests.java index 3f11315981974..86e73b1470602 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupListResultTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupListResultTests.java @@ -8,6 +8,7 @@ import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupInner; import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; import com.azure.resourcemanager.sphere.models.DeviceGroupListResult; +import com.azure.resourcemanager.sphere.models.DeviceGroupProperties; import com.azure.resourcemanager.sphere.models.OSFeedType; import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; import com.azure.resourcemanager.sphere.models.UpdatePolicy; @@ -17,57 +18,38 @@ public final class DeviceGroupListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DeviceGroupListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"description\":\"bvyvdcsity\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":true,\"provisioningState\":\"Provisioning\"},\"id\":\"qsc\",\"name\":\"eypvhezrkg\",\"type\":\"hcjrefovgmk\"},{\"properties\":{\"description\":\"eyyvxyqjpkcat\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":true,\"provisioningState\":\"Succeeded\"},\"id\":\"jh\",\"name\":\"mdajv\",\"type\":\"ysou\"},{\"properties\":{\"description\":\"canoaeupf\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"UpdateAll\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":true,\"provisioningState\":\"Updating\"},\"id\":\"matuok\",\"name\":\"hfuiuaodsfc\",\"type\":\"kvxod\"},{\"properties\":{\"description\":\"zmyzydagf\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":true,\"provisioningState\":\"Deleting\"},\"id\":\"whrdxwzywqsmbsu\",\"name\":\"exim\",\"type\":\"ryocfsfksymdd\"}],\"nextLink\":\"tki\"}") - .toObject(DeviceGroupListResult.class); - Assertions.assertEquals("bvyvdcsity", model.value().get(0).description()); - Assertions.assertEquals(OSFeedType.RETAIL, model.value().get(0).osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.value().get(0).updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, model.value().get(0).allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.value().get(0).regionalDataBoundary()); - Assertions.assertEquals("tki", model.nextLink()); + DeviceGroupListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"description\":\"oaeupfhyhltrpmo\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"UpdateAll\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":true,\"provisioningState\":\"Failed\"},\"id\":\"iuaod\",\"name\":\"fcp\",\"type\":\"vxodpu\"},{\"properties\":{\"description\":\"yzydagfuaxbezyi\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":false,\"provisioningState\":\"Failed\"},\"id\":\"q\",\"name\":\"mbsureximo\",\"type\":\"yocf\"},{\"properties\":{\"description\":\"s\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"UpdateAll\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":false,\"provisioningState\":\"Failed\"},\"id\":\"yudxorrqnbp\",\"name\":\"czvyifq\",\"type\":\"vkd\"}],\"nextLink\":\"sllr\"}") + .toObject(DeviceGroupListResult.class); + Assertions.assertEquals("oaeupfhyhltrpmo", model.value().get(0).properties().description()); + Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.value().get(0).properties().osFeedType()); + Assertions.assertEquals(UpdatePolicy.UPDATE_ALL, model.value().get(0).properties().updatePolicy()); + Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, + model.value().get(0).properties().allowCrashDumpsCollection()); + Assertions.assertEquals(RegionalDataBoundary.NONE, model.value().get(0).properties().regionalDataBoundary()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeviceGroupListResult model = - new DeviceGroupListResult() - .withValue( - Arrays - .asList( - new DeviceGroupInner() - .withDescription("bvyvdcsity") - .withOsFeedType(OSFeedType.RETAIL) - .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.ENABLED) - .withRegionalDataBoundary(RegionalDataBoundary.EU), - new DeviceGroupInner() - .withDescription("eyyvxyqjpkcat") - .withOsFeedType(OSFeedType.RETAIL) - .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) - .withRegionalDataBoundary(RegionalDataBoundary.EU), - new DeviceGroupInner() - .withDescription("canoaeupf") - .withOsFeedType(OSFeedType.RETAIL_EVAL) - .withUpdatePolicy(UpdatePolicy.UPDATE_ALL) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.ENABLED) - .withRegionalDataBoundary(RegionalDataBoundary.EU), - new DeviceGroupInner() - .withDescription("zmyzydagf") - .withOsFeedType(OSFeedType.RETAIL_EVAL) - .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) - .withRegionalDataBoundary(RegionalDataBoundary.EU))) - .withNextLink("tki"); + DeviceGroupListResult model = new DeviceGroupListResult().withValue(Arrays.asList( + new DeviceGroupInner().withProperties(new DeviceGroupProperties().withDescription("oaeupfhyhltrpmo") + .withOsFeedType(OSFeedType.RETAIL_EVAL).withUpdatePolicy(UpdatePolicy.UPDATE_ALL) + .withAllowCrashDumpsCollection(AllowCrashDumpCollection.ENABLED) + .withRegionalDataBoundary(RegionalDataBoundary.NONE)), + new DeviceGroupInner().withProperties(new DeviceGroupProperties().withDescription("yzydagfuaxbezyi") + .withOsFeedType(OSFeedType.RETAIL_EVAL).withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) + .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) + .withRegionalDataBoundary(RegionalDataBoundary.EU)), + new DeviceGroupInner().withProperties(new DeviceGroupProperties().withDescription("s") + .withOsFeedType(OSFeedType.RETAIL_EVAL).withUpdatePolicy(UpdatePolicy.UPDATE_ALL) + .withAllowCrashDumpsCollection(AllowCrashDumpCollection.ENABLED) + .withRegionalDataBoundary(RegionalDataBoundary.NONE)))); model = BinaryData.fromObject(model).toObject(DeviceGroupListResult.class); - Assertions.assertEquals("bvyvdcsity", model.value().get(0).description()); - Assertions.assertEquals(OSFeedType.RETAIL, model.value().get(0).osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.value().get(0).updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, model.value().get(0).allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.value().get(0).regionalDataBoundary()); - Assertions.assertEquals("tki", model.nextLink()); + Assertions.assertEquals("oaeupfhyhltrpmo", model.value().get(0).properties().description()); + Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.value().get(0).properties().osFeedType()); + Assertions.assertEquals(UpdatePolicy.UPDATE_ALL, model.value().get(0).properties().updatePolicy()); + Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, + model.value().get(0).properties().allowCrashDumpsCollection()); + Assertions.assertEquals(RegionalDataBoundary.NONE, model.value().get(0).properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupPropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupPropertiesTests.java index 445027d88fdb7..68cf41bc666ae 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupPropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupPropertiesTests.java @@ -5,8 +5,8 @@ package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupProperties; import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; +import com.azure.resourcemanager.sphere.models.DeviceGroupProperties; import com.azure.resourcemanager.sphere.models.OSFeedType; import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; import com.azure.resourcemanager.sphere.models.UpdatePolicy; @@ -15,32 +15,27 @@ public final class DeviceGroupPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DeviceGroupProperties model = - BinaryData - .fromString( - "{\"description\":\"iqzbq\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":true,\"provisioningState\":\"Deleting\"}") - .toObject(DeviceGroupProperties.class); - Assertions.assertEquals("iqzbq", model.description()); + DeviceGroupProperties model = BinaryData.fromString( + "{\"description\":\"hzdobpxjmflbvvnc\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":true,\"provisioningState\":\"Failed\"}") + .toObject(DeviceGroupProperties.class); + Assertions.assertEquals("hzdobpxjmflbvvnc", model.description()); Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.osFeedType()); Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.updatePolicy()); Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.regionalDataBoundary()); + Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeviceGroupProperties model = - new DeviceGroupProperties() - .withDescription("iqzbq") - .withOsFeedType(OSFeedType.RETAIL_EVAL) - .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) - .withRegionalDataBoundary(RegionalDataBoundary.NONE); + DeviceGroupProperties model = new DeviceGroupProperties().withDescription("hzdobpxjmflbvvnc") + .withOsFeedType(OSFeedType.RETAIL_EVAL).withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) + .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) + .withRegionalDataBoundary(RegionalDataBoundary.EU); model = BinaryData.fromObject(model).toObject(DeviceGroupProperties.class); - Assertions.assertEquals("iqzbq", model.description()); + Assertions.assertEquals("hzdobpxjmflbvvnc", model.description()); Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.osFeedType()); Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.updatePolicy()); Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.regionalDataBoundary()); + Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdatePropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdatePropertiesTests.java index b0e15ed3d3827..d5aaea99a647d 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdatePropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdatePropertiesTests.java @@ -5,8 +5,8 @@ package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeviceGroupUpdateProperties; import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; +import com.azure.resourcemanager.sphere.models.DeviceGroupUpdateProperties; import com.azure.resourcemanager.sphere.models.OSFeedType; import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; import com.azure.resourcemanager.sphere.models.UpdatePolicy; @@ -15,32 +15,27 @@ public final class DeviceGroupUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DeviceGroupUpdateProperties model = - BinaryData - .fromString( - "{\"description\":\"cocmnyyaztt\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"UpdateAll\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"EU\"}") - .toObject(DeviceGroupUpdateProperties.class); - Assertions.assertEquals("cocmnyyaztt", model.description()); + DeviceGroupUpdateProperties model = BinaryData.fromString( + "{\"description\":\"kjz\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"UpdateAll\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"None\"}") + .toObject(DeviceGroupUpdateProperties.class); + Assertions.assertEquals("kjz", model.description()); Assertions.assertEquals(OSFeedType.RETAIL, model.osFeedType()); Assertions.assertEquals(UpdatePolicy.UPDATE_ALL, model.updatePolicy()); Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); + Assertions.assertEquals(RegionalDataBoundary.NONE, model.regionalDataBoundary()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeviceGroupUpdateProperties model = - new DeviceGroupUpdateProperties() - .withDescription("cocmnyyaztt") - .withOsFeedType(OSFeedType.RETAIL) - .withUpdatePolicy(UpdatePolicy.UPDATE_ALL) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) - .withRegionalDataBoundary(RegionalDataBoundary.EU); + DeviceGroupUpdateProperties model = new DeviceGroupUpdateProperties().withDescription("kjz") + .withOsFeedType(OSFeedType.RETAIL).withUpdatePolicy(UpdatePolicy.UPDATE_ALL) + .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) + .withRegionalDataBoundary(RegionalDataBoundary.NONE); model = BinaryData.fromObject(model).toObject(DeviceGroupUpdateProperties.class); - Assertions.assertEquals("cocmnyyaztt", model.description()); + Assertions.assertEquals("kjz", model.description()); Assertions.assertEquals(OSFeedType.RETAIL, model.osFeedType()); Assertions.assertEquals(UpdatePolicy.UPDATE_ALL, model.updatePolicy()); Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); + Assertions.assertEquals(RegionalDataBoundary.NONE, model.regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdateTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdateTests.java index 2fef5ffd910aa..1f09bd0a1f540 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdateTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupUpdateTests.java @@ -7,6 +7,7 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; import com.azure.resourcemanager.sphere.models.DeviceGroupUpdate; +import com.azure.resourcemanager.sphere.models.DeviceGroupUpdateProperties; import com.azure.resourcemanager.sphere.models.OSFeedType; import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; import com.azure.resourcemanager.sphere.models.UpdatePolicy; @@ -15,32 +16,28 @@ public final class DeviceGroupUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DeviceGroupUpdate model = - BinaryData - .fromString( - "{\"properties\":{\"description\":\"xdbabphlwr\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"EU\"}}") - .toObject(DeviceGroupUpdate.class); - Assertions.assertEquals("xdbabphlwr", model.description()); - Assertions.assertEquals(OSFeedType.RETAIL, model.osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); + DeviceGroupUpdate model = BinaryData.fromString( + "{\"properties\":{\"description\":\"xquk\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"EU\"}}") + .toObject(DeviceGroupUpdate.class); + Assertions.assertEquals("xquk", model.properties().description()); + Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.properties().osFeedType()); + Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.properties().updatePolicy()); + Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.properties().allowCrashDumpsCollection()); + Assertions.assertEquals(RegionalDataBoundary.EU, model.properties().regionalDataBoundary()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeviceGroupUpdate model = - new DeviceGroupUpdate() - .withDescription("xdbabphlwr") - .withOsFeedType(OSFeedType.RETAIL) - .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) - .withAllowCrashDumpsCollection(AllowCrashDumpCollection.ENABLED) - .withRegionalDataBoundary(RegionalDataBoundary.EU); + DeviceGroupUpdate model + = new DeviceGroupUpdate().withProperties(new DeviceGroupUpdateProperties().withDescription("xquk") + .withOsFeedType(OSFeedType.RETAIL_EVAL).withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) + .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) + .withRegionalDataBoundary(RegionalDataBoundary.EU)); model = BinaryData.fromObject(model).toObject(DeviceGroupUpdate.class); - Assertions.assertEquals("xdbabphlwr", model.description()); - Assertions.assertEquals(OSFeedType.RETAIL, model.osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, model.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); + Assertions.assertEquals("xquk", model.properties().description()); + Assertions.assertEquals(OSFeedType.RETAIL_EVAL, model.properties().osFeedType()); + Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, model.properties().updatePolicy()); + Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, model.properties().allowCrashDumpsCollection()); + Assertions.assertEquals(RegionalDataBoundary.EU, model.properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCountDevicesWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCountDevicesWithResponseMockTests.java index cf62cf1fa5eb8..829d574b47b02 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCountDevicesWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCountDevicesWithResponseMockTests.java @@ -12,7 +12,7 @@ import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; import com.azure.resourcemanager.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.CountDeviceResponse; +import com.azure.resourcemanager.sphere.models.CountDevicesResponse; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; @@ -30,40 +30,26 @@ public void testCountDevicesWithResponse() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":802895356}"; + String responseStr = "{\"value\":326673667}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - CountDeviceResponse response = - manager - .deviceGroups() - .countDevicesWithResponse("sphyoulpjrvxa", "l", "vimjwos", "tx", com.azure.core.util.Context.NONE) - .getValue(); + CountDevicesResponse response = manager.deviceGroups().countDevicesWithResponse("elpcirelsfeaenwa", "fatkld", + "xbjhwuaanozjosph", "oulpjrv", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals(802895356, response.value()); + Assertions.assertEquals(326673667, response.value()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCreateOrUpdateMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCreateOrUpdateMockTests.java index cb460507b2e43..9f6376ba8a795 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCreateOrUpdateMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsCreateOrUpdateMockTests.java @@ -14,6 +14,7 @@ import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.AllowCrashDumpCollection; import com.azure.resourcemanager.sphere.models.DeviceGroup; +import com.azure.resourcemanager.sphere.models.DeviceGroupProperties; import com.azure.resourcemanager.sphere.models.OSFeedType; import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; import com.azure.resourcemanager.sphere.models.UpdatePolicy; @@ -34,51 +35,36 @@ public void testCreateOrUpdate() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"properties\":{\"description\":\"oduhp\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":false,\"provisioningState\":\"Succeeded\"},\"id\":\"xqugjhkycubedd\",\"name\":\"ssofwqmzqa\",\"type\":\"krmnjijpxacqqud\"}"; + String responseStr + = "{\"properties\":{\"description\":\"oduhp\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":false,\"provisioningState\":\"Succeeded\"},\"id\":\"qugjhkycube\",\"name\":\"dgssofwqmzqal\",\"type\":\"rmnjijpx\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - DeviceGroup response = - manager - .deviceGroups() - .define("dunyg") - .withExistingProduct("cskfcktqumiekk", "zzikhlyfjhdg", "gge") - .withDescription("idb") - .withOsFeedType(OSFeedType.RETAIL) - .withUpdatePolicy(UpdatePolicy.UPDATE_ALL) + DeviceGroup response = manager.deviceGroups().define("gge") + .withExistingProduct("glrvimjwosytxi", "cskfcktqumiekk", "zzikhlyfjhdg") + .withProperties(new DeviceGroupProperties().withDescription("nyga").withOsFeedType(OSFeedType.RETAIL) + .withUpdatePolicy(UpdatePolicy.NO3RD_PARTY_APP_UPDATES) .withAllowCrashDumpsCollection(AllowCrashDumpCollection.DISABLED) - .withRegionalDataBoundary(RegionalDataBoundary.EU) - .create(); + .withRegionalDataBoundary(RegionalDataBoundary.NONE)) + .create(); - Assertions.assertEquals("oduhp", response.description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, response.osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, response.updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, response.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.EU, response.regionalDataBoundary()); + Assertions.assertEquals("oduhp", response.properties().description()); + Assertions.assertEquals(OSFeedType.RETAIL_EVAL, response.properties().osFeedType()); + Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, response.properties().updatePolicy()); + Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, response.properties().allowCrashDumpsCollection()); + Assertions.assertEquals(RegionalDataBoundary.EU, response.properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsDeleteMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsDeleteMockTests.java index ad74f2a3ce680..356103c2be9e5 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsDeleteMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsDeleteMockTests.java @@ -32,32 +32,21 @@ public void testDelete() throws Exception { Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .deviceGroups() - .delete("wczelpci", "elsfeaen", "abfatkl", "dxbjhwuaanozj", com.azure.core.util.Context.NONE); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.deviceGroups().delete("imfnjhfjx", "mszkkfo", "rey", "kzikfjawneaivxwc", + com.azure.core.util.Context.NONE); + } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsGetWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsGetWithResponseMockTests.java index c15479bbbd942..414e69870be1c 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsGetWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsGetWithResponseMockTests.java @@ -34,45 +34,31 @@ public void testGetWithResponse() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"properties\":{\"description\":\"npkukghimdblx\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":false,\"provisioningState\":\"Accepted\"},\"id\":\"szkkfoqre\",\"name\":\"fkzikfj\",\"type\":\"wneaiv\"}"; + String responseStr + = "{\"properties\":{\"description\":\"v\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":true,\"provisioningState\":\"Updating\"},\"id\":\"dxepxgyq\",\"name\":\"gvr\",\"type\":\"mnpkukghimdblxg\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - DeviceGroup response = - manager - .deviceGroups() - .getWithResponse("mtdaa", "gdv", "vgpiohgwxrt", "udxepxgyqagv", com.azure.core.util.Context.NONE) - .getValue(); + DeviceGroup response = manager.deviceGroups() + .getWithResponse("xxmueedn", "rdvstkwqqtch", "alm", "mtdaa", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("npkukghimdblx", response.description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, response.osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, response.updatePolicy()); - Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, response.allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.NONE, response.regionalDataBoundary()); + Assertions.assertEquals("v", response.properties().description()); + Assertions.assertEquals(OSFeedType.RETAIL_EVAL, response.properties().osFeedType()); + Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, response.properties().updatePolicy()); + Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, response.properties().allowCrashDumpsCollection()); + Assertions.assertEquals(RegionalDataBoundary.NONE, response.properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsListByProductMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsListByProductMockTests.java index a5388dfb9b504..078108c614720 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsListByProductMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceGroupsListByProductMockTests.java @@ -35,53 +35,34 @@ public void testListByProduct() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"ggxkallatmelwuip\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":false,\"provisioningState\":\"Accepted\"},\"id\":\"nayrhyrnxxmueedn\",\"name\":\"rdvstkwqqtch\",\"type\":\"alm\"}]}"; + String responseStr + = "{\"value\":[{\"properties\":{\"description\":\"mqg\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Enabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":true,\"provisioningState\":\"Provisioning\"},\"id\":\"allatmelwuipic\",\"name\":\"jzkzi\",\"type\":\"gvvcnayrhyr\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = - manager - .deviceGroups() - .listByProduct( - "tdtbnnhadooc", - "kvci", - "hnvpamqgxq", - "u", - 1862318440, - 443622503, - 1817330156, - com.azure.core.util.Context.NONE); + PagedIterable response = manager.deviceGroups().listByProduct("lxdy", "gsyocogj", "tdtbnnhadooc", + "kvci", 464313768, 1515797519, 600474862, com.azure.core.util.Context.NONE); - Assertions.assertEquals("ggxkallatmelwuip", response.iterator().next().description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, response.iterator().next().osFeedType()); - Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, response.iterator().next().updatePolicy()); - Assertions - .assertEquals(AllowCrashDumpCollection.ENABLED, response.iterator().next().allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.NONE, response.iterator().next().regionalDataBoundary()); + Assertions.assertEquals("mqg", response.iterator().next().properties().description()); + Assertions.assertEquals(OSFeedType.RETAIL, response.iterator().next().properties().osFeedType()); + Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, + response.iterator().next().properties().updatePolicy()); + Assertions.assertEquals(AllowCrashDumpCollection.ENABLED, + response.iterator().next().properties().allowCrashDumpsCollection()); + Assertions.assertEquals(RegionalDataBoundary.NONE, + response.iterator().next().properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInnerTests.java index e7cd923a440ba..57dbd6f596d0f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInnerTests.java @@ -6,23 +6,22 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.sphere.fluent.models.DeviceInner; +import com.azure.resourcemanager.sphere.models.DeviceProperties; import org.junit.jupiter.api.Assertions; public final class DeviceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DeviceInner model = - BinaryData - .fromString( - "{\"properties\":{\"deviceId\":\"wutttxfvjrbi\",\"chipSku\":\"hxepcyvahfnlj\",\"lastAvailableOsVersion\":\"qxj\",\"lastInstalledOsVersion\":\"ujqgidok\",\"lastOsUpdateUtc\":\"2021-09-28T11:40:31Z\",\"lastUpdateRequestUtc\":\"2021-11-13T00:56:49Z\",\"provisioningState\":\"Accepted\"},\"id\":\"gvcl\",\"name\":\"bgsncghkjeszzhb\",\"type\":\"jhtxfvgxbfsmxne\"}") - .toObject(DeviceInner.class); - Assertions.assertEquals("wutttxfvjrbi", model.deviceId()); + DeviceInner model = BinaryData.fromString( + "{\"properties\":{\"deviceId\":\"kpikadrgvt\",\"chipSku\":\"gnbuy\",\"lastAvailableOsVersion\":\"ijggmebfsiar\",\"lastInstalledOsVersion\":\"trcvpnazzmh\",\"lastOsUpdateUtc\":\"2021-11-09T20:12:13Z\",\"lastUpdateRequestUtc\":\"2021-02-24T15:52:09Z\",\"provisioningState\":\"Provisioning\"},\"id\":\"tdbhrbnla\",\"name\":\"kx\",\"type\":\"yskpbhen\"}") + .toObject(DeviceInner.class); + Assertions.assertEquals("kpikadrgvt", model.properties().deviceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeviceInner model = new DeviceInner().withDeviceId("wutttxfvjrbi"); + DeviceInner model = new DeviceInner().withProperties(new DeviceProperties().withDeviceId("kpikadrgvt")); model = BinaryData.fromObject(model).toObject(DeviceInner.class); - Assertions.assertEquals("wutttxfvjrbi", model.deviceId()); + Assertions.assertEquals("kpikadrgvt", model.properties().deviceId()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInsightInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInsightInnerTests.java index 3241802fb0647..d4df5de833d42 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInsightInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceInsightInnerTests.java @@ -12,41 +12,33 @@ public final class DeviceInsightInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DeviceInsightInner model = - BinaryData - .fromString( - "{\"deviceId\":\"eggzfb\",\"description\":\"hfmvfaxkffe\",\"startTimestampUtc\":\"2021-04-21T05:15:54Z\",\"endTimestampUtc\":\"2021-05-15T04:16:32Z\",\"eventCategory\":\"hl\",\"eventClass\":\"m\",\"eventType\":\"zy\",\"eventCount\":2122365511}") - .toObject(DeviceInsightInner.class); - Assertions.assertEquals("eggzfb", model.deviceId()); - Assertions.assertEquals("hfmvfaxkffe", model.description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-21T05:15:54Z"), model.startTimestampUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-15T04:16:32Z"), model.endTimestampUtc()); - Assertions.assertEquals("hl", model.eventCategory()); - Assertions.assertEquals("m", model.eventClass()); - Assertions.assertEquals("zy", model.eventType()); - Assertions.assertEquals(2122365511, model.eventCount()); + DeviceInsightInner model = BinaryData.fromString( + "{\"deviceId\":\"ntypmrbpizcdrqj\",\"description\":\"dpydn\",\"startTimestampUtc\":\"2021-02-06T09:08:09Z\",\"endTimestampUtc\":\"2021-07-10T19:26:28Z\",\"eventCategory\":\"xdeoejzic\",\"eventClass\":\"ifsjttgzfbishcb\",\"eventType\":\"hajdeyeamdpha\",\"eventCount\":1536073800}") + .toObject(DeviceInsightInner.class); + Assertions.assertEquals("ntypmrbpizcdrqj", model.deviceId()); + Assertions.assertEquals("dpydn", model.description()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T09:08:09Z"), model.startTimestampUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-10T19:26:28Z"), model.endTimestampUtc()); + Assertions.assertEquals("xdeoejzic", model.eventCategory()); + Assertions.assertEquals("ifsjttgzfbishcb", model.eventClass()); + Assertions.assertEquals("hajdeyeamdpha", model.eventType()); + Assertions.assertEquals(1536073800, model.eventCount()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeviceInsightInner model = - new DeviceInsightInner() - .withDeviceId("eggzfb") - .withDescription("hfmvfaxkffe") - .withStartTimestampUtc(OffsetDateTime.parse("2021-04-21T05:15:54Z")) - .withEndTimestampUtc(OffsetDateTime.parse("2021-05-15T04:16:32Z")) - .withEventCategory("hl") - .withEventClass("m") - .withEventType("zy") - .withEventCount(2122365511); + DeviceInsightInner model = new DeviceInsightInner().withDeviceId("ntypmrbpizcdrqj").withDescription("dpydn") + .withStartTimestampUtc(OffsetDateTime.parse("2021-02-06T09:08:09Z")) + .withEndTimestampUtc(OffsetDateTime.parse("2021-07-10T19:26:28Z")).withEventCategory("xdeoejzic") + .withEventClass("ifsjttgzfbishcb").withEventType("hajdeyeamdpha").withEventCount(1536073800); model = BinaryData.fromObject(model).toObject(DeviceInsightInner.class); - Assertions.assertEquals("eggzfb", model.deviceId()); - Assertions.assertEquals("hfmvfaxkffe", model.description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-21T05:15:54Z"), model.startTimestampUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-15T04:16:32Z"), model.endTimestampUtc()); - Assertions.assertEquals("hl", model.eventCategory()); - Assertions.assertEquals("m", model.eventClass()); - Assertions.assertEquals("zy", model.eventType()); - Assertions.assertEquals(2122365511, model.eventCount()); + Assertions.assertEquals("ntypmrbpizcdrqj", model.deviceId()); + Assertions.assertEquals("dpydn", model.description()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T09:08:09Z"), model.startTimestampUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-10T19:26:28Z"), model.endTimestampUtc()); + Assertions.assertEquals("xdeoejzic", model.eventCategory()); + Assertions.assertEquals("ifsjttgzfbishcb", model.eventClass()); + Assertions.assertEquals("hajdeyeamdpha", model.eventType()); + Assertions.assertEquals(1536073800, model.eventCount()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceListResultTests.java index 0fb84591ce8b2..f4eada2463b19 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceListResultTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceListResultTests.java @@ -7,35 +7,27 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.sphere.fluent.models.DeviceInner; import com.azure.resourcemanager.sphere.models.DeviceListResult; +import com.azure.resourcemanager.sphere.models.DeviceProperties; import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class DeviceListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DeviceListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"deviceId\":\"zsbbzoggigrxwb\",\"chipSku\":\"vjxxjnsp\",\"lastAvailableOsVersion\":\"ptkoenkoukn\",\"lastInstalledOsVersion\":\"dwtiukbldngkp\",\"lastOsUpdateUtc\":\"2021-05-04T07:17:38Z\",\"lastUpdateRequestUtc\":\"2021-05-19T00:57:25Z\",\"provisioningState\":\"Canceled\"},\"id\":\"xoegukgjnpiucgy\",\"name\":\"evqzntypmrbp\",\"type\":\"zcdrqjsdpydnfyhx\"},{\"properties\":{\"deviceId\":\"ejzicwifsjtt\",\"chipSku\":\"fbishcbkha\",\"lastAvailableOsVersion\":\"eyeam\",\"lastInstalledOsVersion\":\"hagalpbuxwgipwh\",\"lastOsUpdateUtc\":\"2021-04-24T13:32:45Z\",\"lastUpdateRequestUtc\":\"2021-08-18T16:08:42Z\",\"provisioningState\":\"Deleting\"},\"id\":\"hwankixzbinjepu\",\"name\":\"tmryw\",\"type\":\"uzoqft\"},{\"properties\":{\"deviceId\":\"zrnkcqvyxlwh\",\"chipSku\":\"sicohoqqnwvlry\",\"lastAvailableOsVersion\":\"w\",\"lastInstalledOsVersion\":\"eun\",\"lastOsUpdateUtc\":\"2021-02-20T01:45:10Z\",\"lastUpdateRequestUtc\":\"2021-10-16T07:10:15Z\",\"provisioningState\":\"Canceled\"},\"id\":\"zko\",\"name\":\"ocukoklyax\",\"type\":\"conuqszfkbeype\"},{\"properties\":{\"deviceId\":\"jmwvvj\",\"chipSku\":\"tcxsenhwlrs\",\"lastAvailableOsVersion\":\"rzpwvlqdqgbiq\",\"lastInstalledOsVersion\":\"ihkaetcktvfc\",\"lastOsUpdateUtc\":\"2021-07-13T01:18:13Z\",\"lastUpdateRequestUtc\":\"2021-09-20T06:05:50Z\",\"provisioningState\":\"Provisioning\"},\"id\":\"m\",\"name\":\"ctq\",\"type\":\"jf\"}],\"nextLink\":\"brjcxe\"}") - .toObject(DeviceListResult.class); - Assertions.assertEquals("zsbbzoggigrxwb", model.value().get(0).deviceId()); - Assertions.assertEquals("brjcxe", model.nextLink()); + DeviceListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"deviceId\":\"uxwgipwho\",\"chipSku\":\"wkgshwa\",\"lastAvailableOsVersion\":\"ixzbinjeputtmryw\",\"lastInstalledOsVersion\":\"zoqftiyqzrnkcqvy\",\"lastOsUpdateUtc\":\"2021-11-01T04:15:41Z\",\"lastUpdateRequestUtc\":\"2021-04-08T10:43:47Z\",\"provisioningState\":\"Provisioning\"},\"id\":\"cohoq\",\"name\":\"nwvlryavwhheunmm\",\"type\":\"hgyxzkonoc\"},{\"properties\":{\"deviceId\":\"klyaxuconu\",\"chipSku\":\"zf\",\"lastAvailableOsVersion\":\"eyp\",\"lastInstalledOsVersion\":\"rmjmwvvjektc\",\"lastOsUpdateUtc\":\"2021-04-14T12:00:30Z\",\"lastUpdateRequestUtc\":\"2021-03-21T19:21:01Z\",\"provisioningState\":\"Provisioning\"},\"id\":\"s\",\"name\":\"frzpwvlqdqgb\",\"type\":\"qylihkaetckt\"},{\"properties\":{\"deviceId\":\"ivfsnk\",\"chipSku\":\"uctqhjfbe\",\"lastAvailableOsVersion\":\"jcxerfuwu\",\"lastInstalledOsVersion\":\"txfvjrbirph\",\"lastOsUpdateUtc\":\"2020-12-25T01:34:04Z\",\"lastUpdateRequestUtc\":\"2021-09-05T13:55:56Z\",\"provisioningState\":\"Provisioning\"},\"id\":\"fnljky\",\"name\":\"xjvuujqgidokg\",\"type\":\"ljyoxgvcltb\"},{\"properties\":{\"deviceId\":\"c\",\"chipSku\":\"kjeszz\",\"lastAvailableOsVersion\":\"ijhtxf\",\"lastInstalledOsVersion\":\"xbf\",\"lastOsUpdateUtc\":\"2021-01-19T10:57:10Z\",\"lastUpdateRequestUtc\":\"2021-05-10T05:23:15Z\",\"provisioningState\":\"Failed\"},\"id\":\"vecxgodebfqkk\",\"name\":\"bmpukgriwflz\",\"type\":\"fbxzpuzycisp\"}],\"nextLink\":\"zahmgkbrpyydhibn\"}") + .toObject(DeviceListResult.class); + Assertions.assertEquals("uxwgipwho", model.value().get(0).properties().deviceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeviceListResult model = - new DeviceListResult() - .withValue( - Arrays - .asList( - new DeviceInner().withDeviceId("zsbbzoggigrxwb"), - new DeviceInner().withDeviceId("ejzicwifsjtt"), - new DeviceInner().withDeviceId("zrnkcqvyxlwh"), - new DeviceInner().withDeviceId("jmwvvj"))) - .withNextLink("brjcxe"); + DeviceListResult model = new DeviceListResult() + .withValue(Arrays.asList(new DeviceInner().withProperties(new DeviceProperties().withDeviceId("uxwgipwho")), + new DeviceInner().withProperties(new DeviceProperties().withDeviceId("klyaxuconu")), + new DeviceInner().withProperties(new DeviceProperties().withDeviceId("ivfsnk")), + new DeviceInner().withProperties(new DeviceProperties().withDeviceId("c")))); model = BinaryData.fromObject(model).toObject(DeviceListResult.class); - Assertions.assertEquals("zsbbzoggigrxwb", model.value().get(0).deviceId()); - Assertions.assertEquals("brjcxe", model.nextLink()); + Assertions.assertEquals("uxwgipwho", model.value().get(0).properties().deviceId()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicePropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicePropertiesTests.java index 20be7d4c930e1..76907e2d7e3cf 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicePropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicePropertiesTests.java @@ -5,24 +5,22 @@ package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeviceProperties; +import com.azure.resourcemanager.sphere.models.DeviceProperties; import org.junit.jupiter.api.Assertions; public final class DevicePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DeviceProperties model = - BinaryData - .fromString( - "{\"deviceId\":\"pvecxgodeb\",\"chipSku\":\"kk\",\"lastAvailableOsVersion\":\"mpukgriw\",\"lastInstalledOsVersion\":\"zlfbxzpuzycispnq\",\"lastOsUpdateUtc\":\"2021-11-25T03:44:38Z\",\"lastUpdateRequestUtc\":\"2021-01-22T12:22:34Z\",\"provisioningState\":\"Succeeded\"}") - .toObject(DeviceProperties.class); - Assertions.assertEquals("pvecxgodeb", model.deviceId()); + DeviceProperties model = BinaryData.fromString( + "{\"deviceId\":\"kcxywnyt\",\"chipSku\":\"synlqidybyxczfc\",\"lastAvailableOsVersion\":\"aaxdbabphlwrq\",\"lastInstalledOsVersion\":\"ktsthsucocmny\",\"lastOsUpdateUtc\":\"2021-08-16T03:52:30Z\",\"lastUpdateRequestUtc\":\"2021-08-27T13:10:53Z\",\"provisioningState\":\"Accepted\"}") + .toObject(DeviceProperties.class); + Assertions.assertEquals("kcxywnyt", model.deviceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeviceProperties model = new DeviceProperties().withDeviceId("pvecxgodeb"); + DeviceProperties model = new DeviceProperties().withDeviceId("kcxywnyt"); model = BinaryData.fromObject(model).toObject(DeviceProperties.class); - Assertions.assertEquals("pvecxgodeb", model.deviceId()); + Assertions.assertEquals("kcxywnyt", model.deviceId()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdatePropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdatePropertiesTests.java index 3422ec72cc78d..9391bfb2e45d1 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdatePropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdatePropertiesTests.java @@ -5,21 +5,21 @@ package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.DeviceUpdateProperties; +import com.azure.resourcemanager.sphere.models.DeviceUpdateProperties; import org.junit.jupiter.api.Assertions; public final class DeviceUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DeviceUpdateProperties model = - BinaryData.fromString("{\"deviceGroupId\":\"swzts\"}").toObject(DeviceUpdateProperties.class); - Assertions.assertEquals("swzts", model.deviceGroupId()); + DeviceUpdateProperties model + = BinaryData.fromString("{\"deviceGroupId\":\"smtxpsieb\"}").toObject(DeviceUpdateProperties.class); + Assertions.assertEquals("smtxpsieb", model.deviceGroupId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeviceUpdateProperties model = new DeviceUpdateProperties().withDeviceGroupId("swzts"); + DeviceUpdateProperties model = new DeviceUpdateProperties().withDeviceGroupId("smtxpsieb"); model = BinaryData.fromObject(model).toObject(DeviceUpdateProperties.class); - Assertions.assertEquals("swzts", model.deviceGroupId()); + Assertions.assertEquals("smtxpsieb", model.deviceGroupId()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdateTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdateTests.java index c79fa66c09ae7..6847d428acc5a 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdateTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DeviceUpdateTests.java @@ -6,20 +6,22 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.sphere.models.DeviceUpdate; +import com.azure.resourcemanager.sphere.models.DeviceUpdateProperties; import org.junit.jupiter.api.Assertions; public final class DeviceUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DeviceUpdate model = - BinaryData.fromString("{\"properties\":{\"deviceGroupId\":\"rhdwbavxbniw\"}}").toObject(DeviceUpdate.class); - Assertions.assertEquals("rhdwbavxbniw", model.deviceGroupId()); + DeviceUpdate model + = BinaryData.fromString("{\"properties\":{\"deviceGroupId\":\"edeojnabc\"}}").toObject(DeviceUpdate.class); + Assertions.assertEquals("edeojnabc", model.properties().deviceGroupId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DeviceUpdate model = new DeviceUpdate().withDeviceGroupId("rhdwbavxbniw"); + DeviceUpdate model + = new DeviceUpdate().withProperties(new DeviceUpdateProperties().withDeviceGroupId("edeojnabc")); model = BinaryData.fromObject(model).toObject(DeviceUpdate.class); - Assertions.assertEquals("rhdwbavxbniw", model.deviceGroupId()); + Assertions.assertEquals("edeojnabc", model.properties().deviceGroupId()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesCreateOrUpdateMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesCreateOrUpdateMockTests.java index 520346241d37c..510dca4e24b13 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesCreateOrUpdateMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesCreateOrUpdateMockTests.java @@ -13,6 +13,7 @@ import com.azure.core.management.profile.AzureProfile; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Device; +import com.azure.resourcemanager.sphere.models.DeviceProperties; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; @@ -30,43 +31,28 @@ public void testCreateOrUpdate() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"properties\":{\"deviceId\":\"wijnh\",\"chipSku\":\"svfycxzbfv\",\"lastAvailableOsVersion\":\"wvrvmtg\",\"lastInstalledOsVersion\":\"ppyostronzmyhgf\",\"lastOsUpdateUtc\":\"2021-12-09T16:00:11Z\",\"lastUpdateRequestUtc\":\"2021-05-13T00:47:52Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"cwaekrrjre\",\"name\":\"fxtsgum\",\"type\":\"jglikkxwslolb\"}"; + String responseStr + = "{\"properties\":{\"deviceId\":\"lvez\",\"chipSku\":\"pqlmfe\",\"lastAvailableOsVersion\":\"erqwkyhkobopg\",\"lastInstalledOsVersion\":\"dkow\",\"lastOsUpdateUtc\":\"2021-04-05T06:25:25Z\",\"lastUpdateRequestUtc\":\"2021-01-20T13:15:44Z\",\"provisioningState\":\"Succeeded\"},\"id\":\"kbwcc\",\"name\":\"njv\",\"type\":\"dw\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Device response = - manager - .devices() - .define("vblm") - .withExistingDeviceGroup("mfiibfggj", "ool", "rwxkvtkkgl", "qwjygvja") - .withDeviceId("zuhbxvvyhgsopb") - .create(); + Device response = manager.devices().define("vtbvkayh") + .withExistingDeviceGroup("whbotzingamv", "phoszqz", "dphqamv", "kfwynw") + .withProperties(new DeviceProperties().withDeviceId("vyqia")).create(); - Assertions.assertEquals("wijnh", response.deviceId()); + Assertions.assertEquals("lvez", response.properties().deviceId()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesDeleteMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesDeleteMockTests.java index b8d82fa33e5b1..956e9375ddc33 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesDeleteMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesDeleteMockTests.java @@ -32,32 +32,21 @@ public void testDelete() throws Exception { Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .devices() - .delete("ob", "pg", "edkowepbqpcrfk", "wccsnjvcdwxlpqek", "tn", com.azure.core.util.Context.NONE); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.devices().delete("dhszfjv", "bgofeljag", "qmqhldvriii", "jnalghf", "vtvsexsowueluq", + com.azure.core.util.Context.NONE); + } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGenerateCapabilityImageMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGenerateCapabilityImageMockTests.java index a860a2190fcb6..6266db384a8c7 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGenerateCapabilityImageMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGenerateCapabilityImageMockTests.java @@ -32,50 +32,28 @@ public void testGenerateCapabilityImage() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"image\":\"qqaatjinrvgou\"}"; + String responseStr = "{\"image\":\"fi\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + SignedCapabilityImageResponse response + = manager.devices().generateCapabilityImage("hahhxvrhmzkwpj", "wws", "ughftqsx", "qxujxukndxd", "grjguufzd", + new GenerateCapabilityImageRequest().withCapabilities( + Arrays.asList(CapabilityType.APPLICATION_DEVELOPMENT, CapabilityType.FIELD_SERVICING)), + com.azure.core.util.Context.NONE); - SignedCapabilityImageResponse response = - manager - .devices() - .generateCapabilityImage( - "htjsying", - "fq", - "tmtdhtmdvypgik", - "gszywk", - "irryuzhlh", - new GenerateCapabilityImageRequest() - .withCapabilities( - Arrays - .asList( - CapabilityType.FIELD_SERVICING, - CapabilityType.APPLICATION_DEVELOPMENT, - CapabilityType.APPLICATION_DEVELOPMENT)), - com.azure.core.util.Context.NONE); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGetWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGetWithResponseMockTests.java index bbe62979f7baf..f8ec6643bb4ad 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGetWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesGetWithResponseMockTests.java @@ -30,47 +30,27 @@ public void testGetWithResponse() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"properties\":{\"deviceId\":\"ygz\",\"chipSku\":\"dnkfx\",\"lastAvailableOsVersion\":\"emdwzrmuhapfc\",\"lastInstalledOsVersion\":\"psqxq\",\"lastOsUpdateUtc\":\"2021-08-14T15:35:59Z\",\"lastUpdateRequestUtc\":\"2021-05-20T12:44:27Z\",\"provisioningState\":\"Canceled\"},\"id\":\"mgccelvezrypq\",\"name\":\"mfe\",\"type\":\"kerqwkyh\"}"; + String responseStr + = "{\"properties\":{\"deviceId\":\"ikpzimejza\",\"chipSku\":\"fzxiavrmb\",\"lastAvailableOsVersion\":\"nokixrjqcirgz\",\"lastInstalledOsVersion\":\"rlazszrnw\",\"lastOsUpdateUtc\":\"2021-07-10T05:57:56Z\",\"lastUpdateRequestUtc\":\"2021-03-11T03:05:15Z\",\"provisioningState\":\"Accepted\"},\"id\":\"pj\",\"name\":\"lwbtlhf\",\"type\":\"sj\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Device response = - manager - .devices() - .getWithResponse( - "amvdkfwynwcvtbv", - "ayhmtnvyqiatkz", - "pcnp", - "zcjaesgvvsccy", - "jguq", - com.azure.core.util.Context.NONE) - .getValue(); + Device response = manager.devices().getWithResponse("slthaq", "x", "smwutwbdsrezpd", "hneuyowqkd", "ytisibir", + com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("ygz", response.deviceId()); + Assertions.assertEquals("ikpzimejza", response.properties().deviceId()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesListByDeviceGroupMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesListByDeviceGroupMockTests.java index 4d4bb7c5ec89d..be59d4cf54a59 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesListByDeviceGroupMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/DevicesListByDeviceGroupMockTests.java @@ -31,41 +31,27 @@ public void testListByDeviceGroup() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"properties\":{\"deviceId\":\"spughftqsxhq\",\"chipSku\":\"j\",\"lastAvailableOsVersion\":\"kndxdigrjgu\",\"lastInstalledOsVersion\":\"zdmsyqtfi\",\"lastOsUpdateUtc\":\"2020-12-25T23:20:44Z\",\"lastUpdateRequestUtc\":\"2021-09-23T10:33:57Z\",\"provisioningState\":\"Updating\"},\"id\":\"ingamvp\",\"name\":\"ho\",\"type\":\"zqzudph\"}]}"; + String responseStr + = "{\"value\":[{\"properties\":{\"deviceId\":\"o\",\"chipSku\":\"hjjklff\",\"lastAvailableOsVersion\":\"ouw\",\"lastInstalledOsVersion\":\"gzrf\",\"lastOsUpdateUtc\":\"2021-01-08T15:42:56Z\",\"lastUpdateRequestUtc\":\"2021-04-04T13:09:14Z\",\"provisioningState\":\"Canceled\"},\"id\":\"ikayuhqlbjbsybb\",\"name\":\"wrv\",\"type\":\"ldgmfpgvmpip\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = - manager - .devices() - .listByDeviceGroup( - "qmqhldvriii", "jnalghf", "vtvsexsowueluq", "hahhxvrhmzkwpj", com.azure.core.util.Context.NONE); + PagedIterable response = manager.devices().listByDeviceGroup("sjabibs", "stawfsdjpvkv", "bjxbkzbzk", + "vncjabudurgk", com.azure.core.util.Context.NONE); - Assertions.assertEquals("spughftqsxhq", response.iterator().next().deviceId()); + Assertions.assertEquals("o", response.iterator().next().properties().deviceId()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/GenerateCapabilityImageRequestTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/GenerateCapabilityImageRequestTests.java index 94189e9c6adc7..53e36e9b5bea8 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/GenerateCapabilityImageRequestTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/GenerateCapabilityImageRequestTests.java @@ -13,19 +13,17 @@ public final class GenerateCapabilityImageRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - GenerateCapabilityImageRequest model = - BinaryData - .fromString("{\"capabilities\":[\"ApplicationDevelopment\"]}") + GenerateCapabilityImageRequest model + = BinaryData.fromString("{\"capabilities\":[\"FieldServicing\",\"FieldServicing\",\"FieldServicing\"]}") .toObject(GenerateCapabilityImageRequest.class); - Assertions.assertEquals(CapabilityType.APPLICATION_DEVELOPMENT, model.capabilities().get(0)); + Assertions.assertEquals(CapabilityType.FIELD_SERVICING, model.capabilities().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - GenerateCapabilityImageRequest model = - new GenerateCapabilityImageRequest() - .withCapabilities(Arrays.asList(CapabilityType.APPLICATION_DEVELOPMENT)); + GenerateCapabilityImageRequest model = new GenerateCapabilityImageRequest().withCapabilities(Arrays + .asList(CapabilityType.FIELD_SERVICING, CapabilityType.FIELD_SERVICING, CapabilityType.FIELD_SERVICING)); model = BinaryData.fromObject(model).toObject(GenerateCapabilityImageRequest.class); - Assertions.assertEquals(CapabilityType.APPLICATION_DEVELOPMENT, model.capabilities().get(0)); + Assertions.assertEquals(CapabilityType.FIELD_SERVICING, model.capabilities().get(0)); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageInnerTests.java index f234938a021bc..e2d472cd92f19 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageInnerTests.java @@ -6,32 +6,28 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.sphere.fluent.models.ImageInner; +import com.azure.resourcemanager.sphere.models.ImageProperties; import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; import org.junit.jupiter.api.Assertions; public final class ImageInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ImageInner model = - BinaryData - .fromString( - "{\"properties\":{\"image\":\"mbe\",\"imageId\":\"pbhtqqrolfpfpsa\",\"imageName\":\"bquxigjy\",\"regionalDataBoundary\":\"EU\",\"uri\":\"aoyfhrtxilnerkuj\",\"description\":\"vlejuvfqa\",\"componentId\":\"lyxwjkcprbnwbx\",\"imageType\":\"OneBl\",\"provisioningState\":\"Provisioning\"},\"id\":\"vpys\",\"name\":\"zdn\",\"type\":\"uj\"}") - .toObject(ImageInner.class); - Assertions.assertEquals("mbe", model.image()); - Assertions.assertEquals("pbhtqqrolfpfpsa", model.imageId()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); + ImageInner model = BinaryData.fromString( + "{\"properties\":{\"image\":\"ymwisdkft\",\"imageId\":\"xmnteiwaop\",\"imageName\":\"mijcmmxdcufufs\",\"regionalDataBoundary\":\"None\",\"uri\":\"zidnsezcxtbzsgfy\",\"description\":\"sne\",\"componentId\":\"dwzjeiach\",\"imageType\":\"CustomerBoardConfig\",\"provisioningState\":\"Failed\"},\"id\":\"nrosfqpte\",\"name\":\"hzzvypyq\",\"type\":\"i\"}") + .toObject(ImageInner.class); + Assertions.assertEquals("ymwisdkft", model.properties().image()); + Assertions.assertEquals("xmnteiwaop", model.properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.NONE, model.properties().regionalDataBoundary()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ImageInner model = - new ImageInner() - .withImage("mbe") - .withImageId("pbhtqqrolfpfpsa") - .withRegionalDataBoundary(RegionalDataBoundary.EU); + ImageInner model = new ImageInner().withProperties(new ImageProperties().withImage("ymwisdkft") + .withImageId("xmnteiwaop").withRegionalDataBoundary(RegionalDataBoundary.NONE)); model = BinaryData.fromObject(model).toObject(ImageInner.class); - Assertions.assertEquals("mbe", model.image()); - Assertions.assertEquals("pbhtqqrolfpfpsa", model.imageId()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); + Assertions.assertEquals("ymwisdkft", model.properties().image()); + Assertions.assertEquals("xmnteiwaop", model.properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.NONE, model.properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageListResultTests.java index 1178f1b98e760..e94c1ff4c9ca6 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageListResultTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImageListResultTests.java @@ -7,6 +7,7 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.sphere.fluent.models.ImageInner; import com.azure.resourcemanager.sphere.models.ImageListResult; +import com.azure.resourcemanager.sphere.models.ImageProperties; import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; import java.util.Arrays; import org.junit.jupiter.api.Assertions; @@ -14,41 +15,24 @@ public final class ImageListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ImageListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"image\":\"duuji\",\"imageId\":\"jczdzevndh\",\"imageName\":\"wpdappdsbdkv\",\"regionalDataBoundary\":\"EU\",\"uri\":\"feusnhut\",\"description\":\"ltmrldh\",\"componentId\":\"jzzd\",\"imageType\":\"Services\",\"provisioningState\":\"Provisioning\"},\"id\":\"oc\",\"name\":\"geablgphuticndvk\",\"type\":\"ozwyiftyhxhuro\"},{\"properties\":{\"image\":\"yxolniwp\",\"imageId\":\"ukjfkgiawxklr\",\"imageName\":\"lwckbasyypnddhs\",\"regionalDataBoundary\":\"EU\",\"uri\":\"cph\",\"description\":\"koty\",\"componentId\":\"gou\",\"imageType\":\"UpdateCertStore\",\"provisioningState\":\"Accepted\"},\"id\":\"i\",\"name\":\"wyqkgfgibm\",\"type\":\"dgak\"},{\"properties\":{\"image\":\"rxybz\",\"imageId\":\"e\",\"imageName\":\"ytb\",\"regionalDataBoundary\":\"None\",\"uri\":\"ouf\",\"description\":\"mnkzsmod\",\"componentId\":\"lougpbkw\",\"imageType\":\"ManifestSet\",\"provisioningState\":\"Failed\"},\"id\":\"uqktap\",\"name\":\"pwgcuertu\",\"type\":\"kdosvqw\"}],\"nextLink\":\"mdgbbjfdd\"}") - .toObject(ImageListResult.class); - Assertions.assertEquals("duuji", model.value().get(0).image()); - Assertions.assertEquals("jczdzevndh", model.value().get(0).imageId()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.value().get(0).regionalDataBoundary()); - Assertions.assertEquals("mdgbbjfdd", model.nextLink()); + ImageListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"image\":\"fouflmmnkzsmo\",\"imageId\":\"glougpbk\",\"imageName\":\"mutduqktaps\",\"regionalDataBoundary\":\"None\",\"uri\":\"uertumk\",\"description\":\"svqwhbmdgbbjfd\",\"componentId\":\"mbmbexppbh\",\"imageType\":\"SecurityMonitor\",\"provisioningState\":\"Accepted\"},\"id\":\"fpfpsalgbquxigj\",\"name\":\"jgzjaoyfhrtx\",\"type\":\"lnerkujysvleju\"},{\"properties\":{\"image\":\"awrlyx\",\"imageId\":\"kcprbnw\",\"imageName\":\"gjvtbv\",\"regionalDataBoundary\":\"None\",\"uri\":\"zdn\",\"description\":\"jq\",\"componentId\":\"hmuouqfprwzwbn\",\"imageType\":\"Applications\",\"provisioningState\":\"Provisioning\"},\"id\":\"uizga\",\"name\":\"x\",\"type\":\"fizuckyf\"}],\"nextLink\":\"rfidfvzwdz\"}") + .toObject(ImageListResult.class); + Assertions.assertEquals("fouflmmnkzsmo", model.value().get(0).properties().image()); + Assertions.assertEquals("glougpbk", model.value().get(0).properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.NONE, model.value().get(0).properties().regionalDataBoundary()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ImageListResult model = - new ImageListResult() - .withValue( - Arrays - .asList( - new ImageInner() - .withImage("duuji") - .withImageId("jczdzevndh") - .withRegionalDataBoundary(RegionalDataBoundary.EU), - new ImageInner() - .withImage("yxolniwp") - .withImageId("ukjfkgiawxklr") - .withRegionalDataBoundary(RegionalDataBoundary.EU), - new ImageInner() - .withImage("rxybz") - .withImageId("e") - .withRegionalDataBoundary(RegionalDataBoundary.NONE))) - .withNextLink("mdgbbjfdd"); + ImageListResult model = new ImageListResult().withValue(Arrays.asList( + new ImageInner().withProperties(new ImageProperties().withImage("fouflmmnkzsmo").withImageId("glougpbk") + .withRegionalDataBoundary(RegionalDataBoundary.NONE)), + new ImageInner().withProperties(new ImageProperties().withImage("awrlyx").withImageId("kcprbnw") + .withRegionalDataBoundary(RegionalDataBoundary.NONE)))); model = BinaryData.fromObject(model).toObject(ImageListResult.class); - Assertions.assertEquals("duuji", model.value().get(0).image()); - Assertions.assertEquals("jczdzevndh", model.value().get(0).imageId()); - Assertions.assertEquals(RegionalDataBoundary.EU, model.value().get(0).regionalDataBoundary()); - Assertions.assertEquals("mdgbbjfdd", model.nextLink()); + Assertions.assertEquals("fouflmmnkzsmo", model.value().get(0).properties().image()); + Assertions.assertEquals("glougpbk", model.value().get(0).properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.NONE, model.value().get(0).properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagePropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagePropertiesTests.java index 2ccbbac3225ad..e62619e021c31 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagePropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagePropertiesTests.java @@ -5,33 +5,28 @@ package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.ImageProperties; +import com.azure.resourcemanager.sphere.models.ImageProperties; import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; import org.junit.jupiter.api.Assertions; public final class ImagePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ImageProperties model = - BinaryData - .fromString( - "{\"image\":\"uhmuouqfprwzwbn\",\"imageId\":\"itnwuizgazxufi\",\"imageName\":\"ckyfih\",\"regionalDataBoundary\":\"None\",\"uri\":\"fvzwdzuhty\",\"description\":\"isdkfthwxmnteiw\",\"componentId\":\"pvkmijcmmxdcuf\",\"imageType\":\"FwConfig\",\"provisioningState\":\"Accepted\"}") - .toObject(ImageProperties.class); - Assertions.assertEquals("uhmuouqfprwzwbn", model.image()); - Assertions.assertEquals("itnwuizgazxufi", model.imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.regionalDataBoundary()); + ImageProperties model = BinaryData.fromString( + "{\"image\":\"inpvswjdkirsoodq\",\"imageId\":\"crmnohjtckwhds\",\"imageName\":\"fiyipjxsqwpgrj\",\"regionalDataBoundary\":\"EU\",\"uri\":\"rcjxvsnbyxqabn\",\"description\":\"cpc\",\"componentId\":\"hurzafblj\",\"imageType\":\"InvalidImageType\",\"provisioningState\":\"Provisioning\"}") + .toObject(ImageProperties.class); + Assertions.assertEquals("inpvswjdkirsoodq", model.image()); + Assertions.assertEquals("crmnohjtckwhds", model.imageId()); + Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ImageProperties model = - new ImageProperties() - .withImage("uhmuouqfprwzwbn") - .withImageId("itnwuizgazxufi") - .withRegionalDataBoundary(RegionalDataBoundary.NONE); + ImageProperties model = new ImageProperties().withImage("inpvswjdkirsoodq").withImageId("crmnohjtckwhds") + .withRegionalDataBoundary(RegionalDataBoundary.EU); model = BinaryData.fromObject(model).toObject(ImageProperties.class); - Assertions.assertEquals("uhmuouqfprwzwbn", model.image()); - Assertions.assertEquals("itnwuizgazxufi", model.imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, model.regionalDataBoundary()); + Assertions.assertEquals("inpvswjdkirsoodq", model.image()); + Assertions.assertEquals("crmnohjtckwhds", model.imageId()); + Assertions.assertEquals(RegionalDataBoundary.EU, model.regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesCreateOrUpdateMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesCreateOrUpdateMockTests.java index f4ae052642594..d7da725227b10 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesCreateOrUpdateMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesCreateOrUpdateMockTests.java @@ -13,6 +13,7 @@ import com.azure.core.management.profile.AzureProfile; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Image; +import com.azure.resourcemanager.sphere.models.ImageProperties; import com.azure.resourcemanager.sphere.models.RegionalDataBoundary; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; @@ -31,47 +32,31 @@ public void testCreateOrUpdate() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"properties\":{\"image\":\"smond\",\"imageId\":\"quxvypomgkop\",\"imageName\":\"hojvpajqgxysmocm\",\"regionalDataBoundary\":\"None\",\"uri\":\"vmkcx\",\"description\":\"apvhelxprgly\",\"componentId\":\"dd\",\"imageType\":\"InvalidImageType\",\"provisioningState\":\"Succeeded\"},\"id\":\"uejrjxgc\",\"name\":\"qibrhosxsdqrhzoy\",\"type\":\"i\"}"; + String responseStr + = "{\"properties\":{\"image\":\"vqtmnub\",\"imageId\":\"kpzksmondjmq\",\"imageName\":\"vypomgkopkwho\",\"regionalDataBoundary\":\"EU\",\"uri\":\"jqg\",\"description\":\"smocmbq\",\"componentId\":\"vmkcx\",\"imageType\":\"Nwfs\",\"provisioningState\":\"Succeeded\"},\"id\":\"elxprglyatddck\",\"name\":\"bcuejrjxgci\",\"type\":\"ibrhosxsdqr\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Image response = - manager - .images() - .define("ld") - .withExistingCatalog("sotbob", "dopcjwvnh") - .withImage("xcxrsl") - .withImageId("utwu") - .withRegionalDataBoundary(RegionalDataBoundary.NONE) - .create(); - - Assertions.assertEquals("smond", response.image()); - Assertions.assertEquals("quxvypomgkop", response.imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, response.regionalDataBoundary()); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + Image response = manager.images().define("apnedgfbcvkc").withExistingCatalog("hdlxyjrxsagafcn", "hgw") + .withProperties(new ImageProperties().withImage("pkeqdcvdrhvoo").withImageId("otbobzdopcj") + .withRegionalDataBoundary(RegionalDataBoundary.EU)) + .create(); + + Assertions.assertEquals("vqtmnub", response.properties().image()); + Assertions.assertEquals("kpzksmondjmq", response.properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.EU, response.properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesDeleteMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesDeleteMockTests.java index f240ed4fe1e8c..f171bb9b80888 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesDeleteMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesDeleteMockTests.java @@ -32,30 +32,20 @@ public void testDelete() throws Exception { Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.images().delete("apnedgfbcvkc", "q", "pkeqdcvdrhvoo", com.azure.core.util.Context.NONE); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.images().delete("a", "lvpnpp", "uflrwd", com.azure.core.util.Context.NONE); + } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesGetWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesGetWithResponseMockTests.java index 42ed4f7bc3cee..c1a692c3bbf74 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesGetWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesGetWithResponseMockTests.java @@ -31,43 +31,29 @@ public void testGetWithResponse() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"properties\":{\"image\":\"clvit\",\"imageId\":\"qzonosggbhcohf\",\"imageName\":\"sjnkal\",\"regionalDataBoundary\":\"EU\",\"uri\":\"iswac\",\"description\":\"gdkz\",\"componentId\":\"wkfvhqcrailvp\",\"imageType\":\"UpdateCertStore\",\"provisioningState\":\"Succeeded\"},\"id\":\"flrwd\",\"name\":\"hdlxyjrxsagafcn\",\"type\":\"hgw\"}"; + String responseStr + = "{\"properties\":{\"image\":\"lkfg\",\"imageId\":\"dneu\",\"imageName\":\"fphsdyhtozfikdow\",\"regionalDataBoundary\":\"None\",\"uri\":\"v\",\"description\":\"xclvit\",\"componentId\":\"qzonosggbhcohf\",\"imageType\":\"OneBl\",\"provisioningState\":\"Accepted\"},\"id\":\"aljutiiswac\",\"name\":\"fgdkzzew\",\"type\":\"fvhqc\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Image response = - manager - .images() - .getWithResponse("fgohdneuelfphs", "yhtozfikdowwqu", "v", com.azure.core.util.Context.NONE) - .getValue(); + Image response = manager.images() + .getWithResponse("mpgcjefuzmuvpbt", "d", "morppxebmnzbtbh", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("clvit", response.image()); - Assertions.assertEquals("qzonosggbhcohf", response.imageId()); - Assertions.assertEquals(RegionalDataBoundary.EU, response.regionalDataBoundary()); + Assertions.assertEquals("lkfg", response.properties().image()); + Assertions.assertEquals("dneu", response.properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.NONE, response.properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesListByCatalogMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesListByCatalogMockTests.java index 7ca2213eed516..84e496ebe6112 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesListByCatalogMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ImagesListByCatalogMockTests.java @@ -32,49 +32,30 @@ public void testListByCatalog() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"properties\":{\"image\":\"xbxwa\",\"imageId\":\"ogqxndlkzgxhuri\",\"imageName\":\"bpodxunkbebxm\",\"regionalDataBoundary\":\"None\",\"uri\":\"ntwlrbqtkoie\",\"description\":\"eotg\",\"componentId\":\"l\",\"imageType\":\"RecoveryManifest\",\"provisioningState\":\"Canceled\"},\"id\":\"lauwzizxbmpgcjef\",\"name\":\"zmuvpbttdumorppx\",\"type\":\"bmnzbtbhjpgl\"}]}"; + String responseStr + = "{\"value\":[{\"properties\":{\"image\":\"tfz\",\"imageId\":\"hhvh\",\"imageName\":\"r\",\"regionalDataBoundary\":\"EU\",\"uri\":\"wobdagxtibqdx\",\"description\":\"wakbogqxndl\",\"componentId\":\"gxhuriplbp\",\"imageType\":\"Services\",\"provisioningState\":\"Deleting\"},\"id\":\"bebxmubyyntwl\",\"name\":\"bqtkoievseotgqr\",\"type\":\"ltmuwlauwzizx\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .images() - .listByCatalog( - "dltfz", - "mhhv", - "gureodkwobdag", - 933543231, - 1861593827, - 1583051460, - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xbxwa", response.iterator().next().image()); - Assertions.assertEquals("ogqxndlkzgxhuri", response.iterator().next().imageId()); - Assertions.assertEquals(RegionalDataBoundary.NONE, response.iterator().next().regionalDataBoundary()); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + PagedIterable response = manager.images().listByCatalog("mwmbes", "dnkwwtppjflcxog", "okonzmnsikvmkqz", + 1984679669, 1625673068, 1138945921, com.azure.core.util.Context.NONE); + + Assertions.assertEquals("tfz", response.iterator().next().properties().image()); + Assertions.assertEquals("hhvh", response.iterator().next().properties().imageId()); + Assertions.assertEquals(RegionalDataBoundary.EU, + response.iterator().next().properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ListDeviceGroupsRequestTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ListDeviceGroupsRequestTests.java index 388386523a1c7..70968a65ae0eb 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ListDeviceGroupsRequestTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ListDeviceGroupsRequestTests.java @@ -11,15 +11,15 @@ public final class ListDeviceGroupsRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ListDeviceGroupsRequest model = - BinaryData.fromString("{\"deviceGroupName\":\"yexfwh\"}").toObject(ListDeviceGroupsRequest.class); - Assertions.assertEquals("yexfwh", model.deviceGroupName()); + ListDeviceGroupsRequest model + = BinaryData.fromString("{\"deviceGroupName\":\"q\"}").toObject(ListDeviceGroupsRequest.class); + Assertions.assertEquals("q", model.deviceGroupName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ListDeviceGroupsRequest model = new ListDeviceGroupsRequest().withDeviceGroupName("yexfwh"); + ListDeviceGroupsRequest model = new ListDeviceGroupsRequest().withDeviceGroupName("q"); model = BinaryData.fromObject(model).toObject(ListDeviceGroupsRequest.class); - Assertions.assertEquals("yexfwh", model.deviceGroupName()); + Assertions.assertEquals("q", model.deviceGroupName()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationDisplayTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationDisplayTests.java index 7b49a47063ce6..919921646ba46 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationDisplayTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationDisplayTests.java @@ -10,11 +10,9 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") - .toObject(OperationDisplay.class); + OperationDisplay model = BinaryData.fromString( + "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") + .toObject(OperationDisplay.class); } @org.junit.jupiter.api.Test diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationInnerTests.java index 2440972f8cc6f..f30b7af5fbae9 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationInnerTests.java @@ -11,11 +11,9 @@ public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); + OperationInner model = BinaryData.fromString( + "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") + .toObject(OperationInner.class); } @org.junit.jupiter.api.Test diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationListResultTests.java index 1e4a38ab5f2e8..da51bda792f98 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationListResultTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationListResultTests.java @@ -10,11 +10,9 @@ public final class OperationListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") - .toObject(OperationListResult.class); + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") + .toObject(OperationListResult.class); } @org.junit.jupiter.api.Test diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationsListMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationsListMockTests.java index b2433e37aaf2f..07a588a03fa11 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationsListMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/OperationsListMockTests.java @@ -30,35 +30,25 @@ public void testList() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"name\":\"xbzpfzab\",\"isDataAction\":false,\"display\":{\"provider\":\"xwtctyqiklbbovpl\",\"resource\":\"bhvgy\",\"operation\":\"uosvmkfssxqukk\",\"description\":\"l\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; + String responseStr + = "{\"value\":[{\"name\":\"hjjdhtldwkyzxuut\",\"isDataAction\":true,\"display\":{\"provider\":\"cwsvlxotog\",\"resource\":\"rupqsxvnmicy\",\"operation\":\"ceoveilovno\",\"description\":\"fj\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); + } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/PagedDeviceInsightTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/PagedDeviceInsightTests.java index dbef79838d8f0..60d98a88b949f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/PagedDeviceInsightTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/PagedDeviceInsightTests.java @@ -14,57 +14,42 @@ public final class PagedDeviceInsightTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PagedDeviceInsight model = - BinaryData - .fromString( - "{\"value\":[{\"deviceId\":\"w\",\"description\":\"hzdobpxjmflbvvnc\",\"startTimestampUtc\":\"2021-11-01T14:14:41Z\",\"endTimestampUtc\":\"2021-05-23T11:48:05Z\",\"eventCategory\":\"cciw\",\"eventClass\":\"zjuqkhrsaj\",\"eventType\":\"wkuofoskghsauu\",\"eventCount\":2118838793},{\"deviceId\":\"jmvxie\",\"description\":\"uugidyjrrfby\",\"startTimestampUtc\":\"2021-09-15T05:38:02Z\",\"endTimestampUtc\":\"2021-05-02T14:53:40Z\",\"eventCategory\":\"v\",\"eventClass\":\"xc\",\"eventType\":\"onpc\",\"eventCount\":316608134}],\"nextLink\":\"cohslkev\"}") - .toObject(PagedDeviceInsight.class); - Assertions.assertEquals("w", model.value().get(0).deviceId()); - Assertions.assertEquals("hzdobpxjmflbvvnc", model.value().get(0).description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-01T14:14:41Z"), model.value().get(0).startTimestampUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-23T11:48:05Z"), model.value().get(0).endTimestampUtc()); - Assertions.assertEquals("cciw", model.value().get(0).eventCategory()); - Assertions.assertEquals("zjuqkhrsaj", model.value().get(0).eventClass()); - Assertions.assertEquals("wkuofoskghsauu", model.value().get(0).eventType()); - Assertions.assertEquals(2118838793, model.value().get(0).eventCount()); - Assertions.assertEquals("cohslkev", model.nextLink()); + PagedDeviceInsight model = BinaryData.fromString( + "{\"value\":[{\"deviceId\":\"rsa\",\"description\":\"iwkuofos\",\"startTimestampUtc\":\"2021-06-28T14:02:06Z\",\"endTimestampUtc\":\"2021-03-08T03:12:48Z\",\"eventCategory\":\"sauuimj\",\"eventClass\":\"vxieduugidyj\",\"eventType\":\"rfbyaosvexcso\",\"eventCount\":771742090},{\"deviceId\":\"clhocohsl\",\"description\":\"ev\",\"startTimestampUtc\":\"2021-02-15T02:43:43Z\",\"endTimestampUtc\":\"2021-07-27T15:45:18Z\",\"eventCategory\":\"gz\",\"eventClass\":\"buhfmvfaxkffeiit\",\"eventType\":\"lvmezyvshxmzsbbz\",\"eventCount\":681165656},{\"deviceId\":\"gigr\",\"description\":\"wburvjxxjnspydpt\",\"startTimestampUtc\":\"2021-07-25T09:18:50Z\",\"endTimestampUtc\":\"2021-09-24T03:08Z\",\"eventCategory\":\"nkoukn\",\"eventClass\":\"udwtiukbl\",\"eventType\":\"ngkpocipazy\",\"eventCount\":212177726}],\"nextLink\":\"gukgjnpiucgygevq\"}") + .toObject(PagedDeviceInsight.class); + Assertions.assertEquals("rsa", model.value().get(0).deviceId()); + Assertions.assertEquals("iwkuofos", model.value().get(0).description()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-28T14:02:06Z"), model.value().get(0).startTimestampUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-08T03:12:48Z"), model.value().get(0).endTimestampUtc()); + Assertions.assertEquals("sauuimj", model.value().get(0).eventCategory()); + Assertions.assertEquals("vxieduugidyj", model.value().get(0).eventClass()); + Assertions.assertEquals("rfbyaosvexcso", model.value().get(0).eventType()); + Assertions.assertEquals(771742090, model.value().get(0).eventCount()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PagedDeviceInsight model = - new PagedDeviceInsight() - .withValue( - Arrays - .asList( - new DeviceInsightInner() - .withDeviceId("w") - .withDescription("hzdobpxjmflbvvnc") - .withStartTimestampUtc(OffsetDateTime.parse("2021-11-01T14:14:41Z")) - .withEndTimestampUtc(OffsetDateTime.parse("2021-05-23T11:48:05Z")) - .withEventCategory("cciw") - .withEventClass("zjuqkhrsaj") - .withEventType("wkuofoskghsauu") - .withEventCount(2118838793), - new DeviceInsightInner() - .withDeviceId("jmvxie") - .withDescription("uugidyjrrfby") - .withStartTimestampUtc(OffsetDateTime.parse("2021-09-15T05:38:02Z")) - .withEndTimestampUtc(OffsetDateTime.parse("2021-05-02T14:53:40Z")) - .withEventCategory("v") - .withEventClass("xc") - .withEventType("onpc") - .withEventCount(316608134))) - .withNextLink("cohslkev"); + PagedDeviceInsight model = new PagedDeviceInsight().withValue(Arrays.asList( + new DeviceInsightInner().withDeviceId("rsa").withDescription("iwkuofos") + .withStartTimestampUtc(OffsetDateTime.parse("2021-06-28T14:02:06Z")) + .withEndTimestampUtc(OffsetDateTime.parse("2021-03-08T03:12:48Z")).withEventCategory("sauuimj") + .withEventClass("vxieduugidyj").withEventType("rfbyaosvexcso").withEventCount(771742090), + new DeviceInsightInner().withDeviceId("clhocohsl").withDescription("ev") + .withStartTimestampUtc(OffsetDateTime.parse("2021-02-15T02:43:43Z")) + .withEndTimestampUtc(OffsetDateTime.parse("2021-07-27T15:45:18Z")).withEventCategory("gz") + .withEventClass("buhfmvfaxkffeiit").withEventType("lvmezyvshxmzsbbz").withEventCount(681165656), + new DeviceInsightInner().withDeviceId("gigr").withDescription("wburvjxxjnspydpt") + .withStartTimestampUtc(OffsetDateTime.parse("2021-07-25T09:18:50Z")) + .withEndTimestampUtc(OffsetDateTime.parse("2021-09-24T03:08Z")).withEventCategory("nkoukn") + .withEventClass("udwtiukbl").withEventType("ngkpocipazy").withEventCount(212177726))); model = BinaryData.fromObject(model).toObject(PagedDeviceInsight.class); - Assertions.assertEquals("w", model.value().get(0).deviceId()); - Assertions.assertEquals("hzdobpxjmflbvvnc", model.value().get(0).description()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-01T14:14:41Z"), model.value().get(0).startTimestampUtc()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-23T11:48:05Z"), model.value().get(0).endTimestampUtc()); - Assertions.assertEquals("cciw", model.value().get(0).eventCategory()); - Assertions.assertEquals("zjuqkhrsaj", model.value().get(0).eventClass()); - Assertions.assertEquals("wkuofoskghsauu", model.value().get(0).eventType()); - Assertions.assertEquals(2118838793, model.value().get(0).eventCount()); - Assertions.assertEquals("cohslkev", model.nextLink()); + Assertions.assertEquals("rsa", model.value().get(0).deviceId()); + Assertions.assertEquals("iwkuofos", model.value().get(0).description()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-28T14:02:06Z"), model.value().get(0).startTimestampUtc()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-08T03:12:48Z"), model.value().get(0).endTimestampUtc()); + Assertions.assertEquals("sauuimj", model.value().get(0).eventCategory()); + Assertions.assertEquals("vxieduugidyj", model.value().get(0).eventClass()); + Assertions.assertEquals("rfbyaosvexcso", model.value().get(0).eventType()); + Assertions.assertEquals(771742090, model.value().get(0).eventCount()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductInnerTests.java index 7080cd4500841..aff0397719aaf 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductInnerTests.java @@ -6,23 +6,22 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.sphere.fluent.models.ProductInner; +import com.azure.resourcemanager.sphere.models.ProductProperties; import org.junit.jupiter.api.Assertions; public final class ProductInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ProductInner model = - BinaryData - .fromString( - "{\"properties\":{\"description\":\"pnazzm\",\"provisioningState\":\"Updating\"},\"id\":\"unmpxttd\",\"name\":\"hrbnlankxmyskpbh\",\"type\":\"nbtkcxywnytnr\"}") - .toObject(ProductInner.class); - Assertions.assertEquals("pnazzm", model.description()); + ProductInner model = BinaryData.fromString( + "{\"properties\":{\"description\":\"s\",\"provisioningState\":\"Provisioning\"},\"id\":\"nxytxh\",\"name\":\"zxbzpfzabglc\",\"type\":\"hxw\"}") + .toObject(ProductInner.class); + Assertions.assertEquals("s", model.properties().description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ProductInner model = new ProductInner().withDescription("pnazzm"); + ProductInner model = new ProductInner().withProperties(new ProductProperties().withDescription("s")); model = BinaryData.fromObject(model).toObject(ProductInner.class); - Assertions.assertEquals("pnazzm", model.description()); + Assertions.assertEquals("s", model.properties().description()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductListResultTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductListResultTests.java index d3e581055b777..f720a65ce7e6f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductListResultTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductListResultTests.java @@ -7,29 +7,24 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.sphere.fluent.models.ProductInner; import com.azure.resourcemanager.sphere.models.ProductListResult; +import com.azure.resourcemanager.sphere.models.ProductProperties; import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ProductListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ProductListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"description\":\"yydhibnuqqk\",\"provisioningState\":\"Accepted\"},\"id\":\"a\",\"name\":\"rgvtqag\",\"type\":\"buynhijggm\"}],\"nextLink\":\"fsiarbutr\"}") - .toObject(ProductListResult.class); - Assertions.assertEquals("yydhibnuqqk", model.value().get(0).description()); - Assertions.assertEquals("fsiarbutr", model.nextLink()); + ProductListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"description\":\"qpuedckzywbiex\",\"provisioningState\":\"Provisioning\"},\"id\":\"ue\",\"name\":\"xibxujwbhqwalm\",\"type\":\"zyoxaepdkzjan\"}],\"nextLink\":\"xrhdwbavxbniwdjs\"}") + .toObject(ProductListResult.class); + Assertions.assertEquals("qpuedckzywbiex", model.value().get(0).properties().description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ProductListResult model = - new ProductListResult() - .withValue(Arrays.asList(new ProductInner().withDescription("yydhibnuqqk"))) - .withNextLink("fsiarbutr"); + ProductListResult model = new ProductListResult().withValue(Arrays + .asList(new ProductInner().withProperties(new ProductProperties().withDescription("qpuedckzywbiex")))); model = BinaryData.fromObject(model).toObject(ProductListResult.class); - Assertions.assertEquals("yydhibnuqqk", model.value().get(0).description()); - Assertions.assertEquals("fsiarbutr", model.nextLink()); + Assertions.assertEquals("qpuedckzywbiex", model.value().get(0).properties().description()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductPropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductPropertiesTests.java index f87b202e7bc39..29d43cc532ecc 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductPropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductPropertiesTests.java @@ -5,23 +5,21 @@ package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.ProductProperties; +import com.azure.resourcemanager.sphere.models.ProductProperties; import org.junit.jupiter.api.Assertions; public final class ProductPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ProductProperties model = - BinaryData - .fromString("{\"description\":\"yn\",\"provisioningState\":\"Provisioning\"}") - .toObject(ProductProperties.class); - Assertions.assertEquals("yn", model.description()); + ProductProperties model = BinaryData.fromString("{\"description\":\"tyq\",\"provisioningState\":\"Failed\"}") + .toObject(ProductProperties.class); + Assertions.assertEquals("tyq", model.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ProductProperties model = new ProductProperties().withDescription("yn"); + ProductProperties model = new ProductProperties().withDescription("tyq"); model = BinaryData.fromObject(model).toObject(ProductProperties.class); - Assertions.assertEquals("yn", model.description()); + Assertions.assertEquals("tyq", model.description()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdatePropertiesTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdatePropertiesTests.java index 5343929ecb72f..6078ea595687b 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdatePropertiesTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdatePropertiesTests.java @@ -5,21 +5,21 @@ package com.azure.resourcemanager.sphere.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.sphere.fluent.models.ProductUpdateProperties; +import com.azure.resourcemanager.sphere.models.ProductUpdateProperties; import org.junit.jupiter.api.Assertions; public final class ProductUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ProductUpdateProperties model = - BinaryData.fromString("{\"description\":\"zfcl\"}").toObject(ProductUpdateProperties.class); - Assertions.assertEquals("zfcl", model.description()); + ProductUpdateProperties model + = BinaryData.fromString("{\"description\":\"hvgyuguosvmk\"}").toObject(ProductUpdateProperties.class); + Assertions.assertEquals("hvgyuguosvmk", model.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ProductUpdateProperties model = new ProductUpdateProperties().withDescription("zfcl"); + ProductUpdateProperties model = new ProductUpdateProperties().withDescription("hvgyuguosvmk"); model = BinaryData.fromObject(model).toObject(ProductUpdateProperties.class); - Assertions.assertEquals("zfcl", model.description()); + Assertions.assertEquals("hvgyuguosvmk", model.description()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdateTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdateTests.java index 0334345eb6613..8ca49441ba247 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdateTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductUpdateTests.java @@ -6,20 +6,22 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.sphere.models.ProductUpdate; +import com.azure.resourcemanager.sphere.models.ProductUpdateProperties; import org.junit.jupiter.api.Assertions; public final class ProductUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ProductUpdate model = - BinaryData.fromString("{\"properties\":{\"description\":\"by\"}}").toObject(ProductUpdate.class); - Assertions.assertEquals("by", model.description()); + ProductUpdate model + = BinaryData.fromString("{\"properties\":{\"description\":\"ovplw\"}}").toObject(ProductUpdate.class); + Assertions.assertEquals("ovplw", model.properties().description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ProductUpdate model = new ProductUpdate().withDescription("by"); + ProductUpdate model + = new ProductUpdate().withProperties(new ProductUpdateProperties().withDescription("ovplw")); model = BinaryData.fromObject(model).toObject(ProductUpdate.class); - Assertions.assertEquals("by", model.description()); + Assertions.assertEquals("ovplw", model.properties().description()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCountDevicesWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCountDevicesWithResponseMockTests.java index cd4aee8357873..d43fa39195c17 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCountDevicesWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCountDevicesWithResponseMockTests.java @@ -12,7 +12,7 @@ import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; import com.azure.resourcemanager.sphere.AzureSphereManager; -import com.azure.resourcemanager.sphere.models.CountDeviceResponse; +import com.azure.resourcemanager.sphere.models.CountDevicesResponse; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; @@ -30,40 +30,27 @@ public void testCountDevicesWithResponse() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{\"value\":1309534736}"; + String responseStr = "{\"value\":890415173}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - CountDeviceResponse response = - manager - .products() - .countDevicesWithResponse("syrsndsytgadgvra", "aeneqnzarrwl", "uu", com.azure.core.util.Context.NONE) - .getValue(); + CountDevicesResponse response = manager.products() + .countDevicesWithResponse("reqnovvqfov", "jxywsuws", "rsndsytgadgvra", com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals(1309534736, response.value()); + Assertions.assertEquals(890415173, response.value()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCreateOrUpdateMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCreateOrUpdateMockTests.java index a8a1ec3e7089c..269b2c67e8009 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCreateOrUpdateMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsCreateOrUpdateMockTests.java @@ -13,6 +13,7 @@ import com.azure.core.management.profile.AzureProfile; import com.azure.resourcemanager.sphere.AzureSphereManager; import com.azure.resourcemanager.sphere.models.Product; +import com.azure.resourcemanager.sphere.models.ProductProperties; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; @@ -30,43 +31,28 @@ public void testCreateOrUpdate() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"properties\":{\"description\":\"orgjhxbldt\",\"provisioningState\":\"Succeeded\"},\"id\":\"rlkdmtncvokotl\",\"name\":\"xdy\",\"type\":\"gsyocogj\"}"; + String responseStr + = "{\"properties\":{\"description\":\"g\",\"provisioningState\":\"Succeeded\"},\"id\":\"mabiknsorgjhxb\",\"name\":\"dtlwwrlkd\",\"type\":\"tncvokot\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Product response = - manager - .products() - .define("ox") - .withExistingCatalog("swsrms", "yzrpzbchckqqzq") - .withDescription("suiizynkedyat") - .create(); + Product response + = manager.products().define("slyzrpzbchckqq").withExistingCatalog("jphuopxodlqi", "ntorzihleosjswsr") + .withProperties(new ProductProperties().withDescription("ox")).create(); - Assertions.assertEquals("orgjhxbldt", response.description()); + Assertions.assertEquals("g", response.properties().description()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsDeleteMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsDeleteMockTests.java index 4348987e39942..af8f664743c81 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsDeleteMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsDeleteMockTests.java @@ -32,30 +32,20 @@ public void testDelete() throws Exception { Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.products().delete("dlpichkoymkcdyhb", "kkpwdreqnovvq", "ovljxywsu", com.azure.core.util.Context.NONE); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); + + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + manager.products().delete("joxafnndlpi", "hkoymkcdyhbp", "kpw", com.azure.core.util.Context.NONE); + } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGenerateDefaultDeviceGroupsMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGenerateDefaultDeviceGroupsMockTests.java index 837c76e3e7b04..302caaffcfb2a 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGenerateDefaultDeviceGroupsMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGenerateDefaultDeviceGroupsMockTests.java @@ -35,43 +35,34 @@ public void testGenerateDefaultDeviceGroups() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"wifto\",\"osFeedType\":\"RetailEval\",\"updatePolicy\":\"UpdateAll\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"None\",\"hasDeployment\":true,\"provisioningState\":\"Failed\"},\"id\":\"aknynfsynljphuop\",\"name\":\"odlqiyntor\",\"type\":\"ihleos\"}]}"; + String responseStr + = "{\"value\":[{\"properties\":{\"description\":\"qkacewii\",\"osFeedType\":\"Retail\",\"updatePolicy\":\"No3rdPartyAppUpdates\",\"allowCrashDumpsCollection\":\"Disabled\",\"regionalDataBoundary\":\"EU\",\"hasDeployment\":true,\"provisioningState\":\"Updating\"},\"id\":\"hqkvpuvksgplsak\",\"name\":\"ynfs\",\"type\":\"n\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = - manager.products().generateDefaultDeviceGroups("fqka", "e", "iipfpubj", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.products().generateDefaultDeviceGroups("en", "qnzarrwl", "uu", com.azure.core.util.Context.NONE); - Assertions.assertEquals("wifto", response.iterator().next().description()); - Assertions.assertEquals(OSFeedType.RETAIL_EVAL, response.iterator().next().osFeedType()); - Assertions.assertEquals(UpdatePolicy.UPDATE_ALL, response.iterator().next().updatePolicy()); - Assertions - .assertEquals(AllowCrashDumpCollection.DISABLED, response.iterator().next().allowCrashDumpsCollection()); - Assertions.assertEquals(RegionalDataBoundary.NONE, response.iterator().next().regionalDataBoundary()); + Assertions.assertEquals("qkacewii", response.iterator().next().properties().description()); + Assertions.assertEquals(OSFeedType.RETAIL, response.iterator().next().properties().osFeedType()); + Assertions.assertEquals(UpdatePolicy.NO3RD_PARTY_APP_UPDATES, + response.iterator().next().properties().updatePolicy()); + Assertions.assertEquals(AllowCrashDumpCollection.DISABLED, + response.iterator().next().properties().allowCrashDumpsCollection()); + Assertions.assertEquals(RegionalDataBoundary.EU, + response.iterator().next().properties().regionalDataBoundary()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGetWithResponseMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGetWithResponseMockTests.java index f8137c9e85dca..ff87bdfb0c29e 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGetWithResponseMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsGetWithResponseMockTests.java @@ -30,41 +30,27 @@ public void testGetWithResponse() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"properties\":{\"description\":\"asipqiio\",\"provisioningState\":\"Accepted\"},\"id\":\"qerpqlpqwcc\",\"name\":\"uqgbdbutauvfbt\",\"type\":\"uwhhmhykojoxafn\"}"; + String responseStr + = "{\"properties\":{\"description\":\"yuq\",\"provisioningState\":\"Provisioning\"},\"id\":\"lp\",\"name\":\"wcciuqgbdbu\",\"type\":\"auvfbtkuwhhmhyk\"}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Product response = - manager - .products() - .getWithResponse("nwashrtd", "kcnqxwbpo", "ulpiuj", com.azure.core.util.Context.NONE) - .getValue(); + Product response = manager.products() + .getWithResponse("kcnqxwbpo", "ulpiuj", "aasipqi", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("asipqiio", response.description()); + Assertions.assertEquals("yuq", response.properties().description()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsListByCatalogMockTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsListByCatalogMockTests.java index 7484fb588ac43..2e3f1473183af 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsListByCatalogMockTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProductsListByCatalogMockTests.java @@ -31,38 +31,27 @@ public void testListByCatalog() throws Exception { HttpResponse httpResponse = Mockito.mock(HttpResponse.class); ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"wfluszdt\",\"provisioningState\":\"Succeeded\"},\"id\":\"kwofyyvoq\",\"name\":\"cpi\",\"type\":\"xpbtgiwbwo\"}]}"; + String responseStr + = "{\"value\":[{\"properties\":{\"description\":\"oqac\",\"provisioningState\":\"Accepted\"},\"id\":\"pbtg\",\"name\":\"wbwo\",\"type\":\"nwashrtd\"}]}"; Mockito.when(httpResponse.getStatusCode()).thenReturn(200); Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) + Mockito.when(httpResponse.getBody()) .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) + Mockito.when(httpResponse.getBodyAsByteArray()) .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { + Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); + return Mono.just(httpResponse); + })); - AzureSphereManager manager = - AzureSphereManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + AzureSphereManager manager = AzureSphereManager.configure().withHttpClient(httpClient).authenticate( + tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = - manager.products().listByCatalog("m", "qyib", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.products().listByCatalog("zoymibmrqyibahw", "luszdtmhrkwof", com.azure.core.util.Context.NONE); - Assertions.assertEquals("wfluszdt", response.iterator().next().description()); + Assertions.assertEquals("oqac", response.iterator().next().properties().description()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceRequestTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceRequestTests.java index 6858ae6e401c7..34e5a6fe072f9 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceRequestTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceRequestTests.java @@ -11,15 +11,15 @@ public final class ProofOfPossessionNonceRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ProofOfPossessionNonceRequest model = - BinaryData.fromString("{\"proofOfPossessionNonce\":\"kwt\"}").toObject(ProofOfPossessionNonceRequest.class); - Assertions.assertEquals("kwt", model.proofOfPossessionNonce()); + ProofOfPossessionNonceRequest model = BinaryData.fromString("{\"proofOfPossessionNonce\":\"jkot\"}") + .toObject(ProofOfPossessionNonceRequest.class); + Assertions.assertEquals("jkot", model.proofOfPossessionNonce()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ProofOfPossessionNonceRequest model = new ProofOfPossessionNonceRequest().withProofOfPossessionNonce("kwt"); + ProofOfPossessionNonceRequest model = new ProofOfPossessionNonceRequest().withProofOfPossessionNonce("jkot"); model = BinaryData.fromObject(model).toObject(ProofOfPossessionNonceRequest.class); - Assertions.assertEquals("kwt", model.proofOfPossessionNonce()); + Assertions.assertEquals("jkot", model.proofOfPossessionNonce()); } } diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceResponseInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceResponseInnerTests.java index 4295b284bcd1d..a27a3f0b1011f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceResponseInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/ProofOfPossessionNonceResponseInnerTests.java @@ -10,11 +10,9 @@ public final class ProofOfPossessionNonceResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ProofOfPossessionNonceResponseInner model = - BinaryData - .fromString( - "{\"certificate\":\"xbnjbiksq\",\"status\":\"Inactive\",\"subject\":\"sainqpjwnzl\",\"thumbprint\":\"fmppe\",\"expiryUtc\":\"2021-03-28T22:28:31Z\",\"notBeforeUtc\":\"2021-11-23T16:03:48Z\",\"provisioningState\":\"Provisioning\"}") - .toObject(ProofOfPossessionNonceResponseInner.class); + ProofOfPossessionNonceResponseInner model = BinaryData.fromString( + "{\"certificate\":\"qgoulznd\",\"status\":\"Active\",\"subject\":\"yqkgfg\",\"thumbprint\":\"madgakeqsrxyb\",\"expiryUtc\":\"2021-03-26T22:16:08Z\",\"notBeforeUtc\":\"2021-02-21T09:55:36Z\",\"provisioningState\":\"Deleting\"}") + .toObject(ProofOfPossessionNonceResponseInner.class); } @org.junit.jupiter.api.Test diff --git a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/SignedCapabilityImageResponseInnerTests.java b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/SignedCapabilityImageResponseInnerTests.java index 54c09a9375131..eadaa20bd300f 100644 --- a/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/SignedCapabilityImageResponseInnerTests.java +++ b/sdk/sphere/azure-resourcemanager-sphere/src/test/java/com/azure/resourcemanager/sphere/generated/SignedCapabilityImageResponseInnerTests.java @@ -10,8 +10,8 @@ public final class SignedCapabilityImageResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SignedCapabilityImageResponseInner model = - BinaryData.fromString("{\"image\":\"nxytxh\"}").toObject(SignedCapabilityImageResponseInner.class); + SignedCapabilityImageResponseInner model + = BinaryData.fromString("{\"image\":\"sapskr\"}").toObject(SignedCapabilityImageResponseInner.class); } @org.junit.jupiter.api.Test diff --git a/sdk/spring/CHANGELOG.md b/sdk/spring/CHANGELOG.md index 90b27f3f967fe..085e1baf757c3 100644 --- a/sdk/spring/CHANGELOG.md +++ b/sdk/spring/CHANGELOG.md @@ -1,6 +1,13 @@ # Release History -## 4.17.0 (unreleased) +## 4.17.0 (2024-03-28) +- This release is compatible with Spring Boot 2.5.0-2.5.15, 2.6.0-2.6.15, 2.7.0-2.7.18. (Note: 2.5.x (x>15), 2.6.y (y>15) and 2.7.z (z>18) should be supported, but they aren't tested with this release.) +- This release is compatible with Spring Cloud 2020.0.3-2020.0.6, 2021.0.0-2021.0.9. (Note: 2020.0.x (x>6) and 2021.0.y (y>9) should be supported, but they aren't tested with this release.) + +### Spring Cloud Azure Dependencies (BOM) + +#### Dependency Updates +- Upgrade `azure-sdk-bom` to 1.2.22. ### Spring Cloud Stream Event Hubs Binder This section includes changes in `spring-cloud-azure-stream-binder-eventhubs` module. @@ -14,6 +21,10 @@ This section includes changes in `spring-cloud-azure-stream-binder-servicebus` m #### Features Added - Support setting values for all channels by using the `spring.cloud.stream.servicebus.default.consumer.=` and `spring.cloud.stream.servicebus.default.producer.=` properties [#39362](https://github.com/Azure/azure-sdk-for-java/pull/39362). +### Azure Spring Data Cosmos +This section includes changes in `azure-spring-data-cosmos` module. +Please refer to [azure-spring-data-cosmos/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/spring/azure-spring-data-cosmos/CHANGELOG.md#3440-2024-03-28) for more details. + ## 5.10.0 (2024-03-01) - This release is compatible with Spring Boot 3.0.0-3.0.13, 3.1.0-3.1.8, 3.2.0-3.2.3. (Note: 3.0.x (x>13), 3.1.y (y>8) and 3.2.z (z>3) should be supported, but they aren't tested with this release.) - This release is compatible with Spring Cloud 2022.0.0-2022.0.5, 2023.0.0-2023.0.0. (Note: 2022.0.x (x>5) and 2023.0.y (y>0) should be supported, but they aren't tested with this release.) diff --git a/sdk/spring/README.md b/sdk/spring/README.md index f40a529aaad9a..bcc381424cf40 100644 --- a/sdk/spring/README.md +++ b/sdk/spring/README.md @@ -139,7 +139,7 @@ If you’re a Maven user, add our BOM to your pom.xml `` s com.azure.spring spring-cloud-azure-dependencies - 4.16.0 + 4.17.0 pom import diff --git a/sdk/spring/azure-spring-data-cosmos/CHANGELOG.md b/sdk/spring/azure-spring-data-cosmos/CHANGELOG.md index 7fb991cb9f2c3..12ea6d97cff25 100644 --- a/sdk/spring/azure-spring-data-cosmos/CHANGELOG.md +++ b/sdk/spring/azure-spring-data-cosmos/CHANGELOG.md @@ -1,15 +1,22 @@ ## Release History -### 3.44.0-beta.1 (Unreleased) +### 3.45.0-beta.1 (Unreleased) #### Features Added #### Breaking Changes +#### Bugs Fixed + +#### Other Changes + +### 3.44.0 (2024-03-28) + #### Bugs Fixed * Fixed `IllegalStateException` for `delete` - See [PR 38996](https://github.com/Azure/azure-sdk-for-java/pull/38996). #### Other Changes +* Updated `azure-cosmos` to version `4.57.0`. ### 5.10.0 (2024-03-01) diff --git a/sdk/spring/azure-spring-data-cosmos/README.md b/sdk/spring/azure-spring-data-cosmos/README.md index 620c87a1cd0c9..433c5488fc33b 100644 --- a/sdk/spring/azure-spring-data-cosmos/README.md +++ b/sdk/spring/azure-spring-data-cosmos/README.md @@ -100,7 +100,7 @@ If you are using Maven, add the following dependency. com.azure azure-spring-data-cosmos - 3.43.0 + 3.44.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/spring/azure-spring-data-cosmos/pom.xml b/sdk/spring/azure-spring-data-cosmos/pom.xml index 6289236364c39..1886abdbc077d 100644 --- a/sdk/spring/azure-spring-data-cosmos/pom.xml +++ b/sdk/spring/azure-spring-data-cosmos/pom.xml @@ -12,7 +12,7 @@ com.azure azure-spring-data-cosmos - 3.44.0-beta.1 + 3.45.0-beta.1 jar Spring Data for Azure Cosmos DB SQL API Spring Data for Azure Cosmos DB SQL API diff --git a/sdk/spring/spring-cloud-azure-actuator-autoconfigure/CHANGELOG.md b/sdk/spring/spring-cloud-azure-actuator-autoconfigure/CHANGELOG.md index d343c5f53303c..465a0ceac20d1 100644 --- a/sdk/spring/spring-cloud-azure-actuator-autoconfigure/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-actuator-autoconfigure/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-actuator-autoconfigure/pom.xml b/sdk/spring/spring-cloud-azure-actuator-autoconfigure/pom.xml index 490d5879de907..0856114a477a0 100644 --- a/sdk/spring/spring-cloud-azure-actuator-autoconfigure/pom.xml +++ b/sdk/spring/spring-cloud-azure-actuator-autoconfigure/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-actuator-autoconfigure - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Actuator AutoConfigure Spring Cloud Azure Starter Actuator AutoConfigure @@ -43,17 +43,17 @@ com.azure.spring spring-cloud-azure-actuator - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-autoconfigure - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-appconfiguration-config-web - 4.17.0-beta.1 + 4.18.0-beta.1 true diff --git a/sdk/spring/spring-cloud-azure-actuator/CHANGELOG.md b/sdk/spring/spring-cloud-azure-actuator/CHANGELOG.md index d343c5f53303c..465a0ceac20d1 100644 --- a/sdk/spring/spring-cloud-azure-actuator/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-actuator/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-actuator/pom.xml b/sdk/spring/spring-cloud-azure-actuator/pom.xml index 2f92f8e2b62d6..3a44a43fda0a6 100644 --- a/sdk/spring/spring-cloud-azure-actuator/pom.xml +++ b/sdk/spring/spring-cloud-azure-actuator/pom.xml @@ -17,7 +17,7 @@ com.azure.spring spring-cloud-azure-actuator - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Actuator https://microsoft.github.io/spring-cloud-azure @@ -105,7 +105,7 @@ com.azure.spring spring-cloud-azure-appconfiguration-config-web - 4.17.0-beta.1 + 4.18.0-beta.1 true diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config-web/CHANGELOG.md b/sdk/spring/spring-cloud-azure-appconfiguration-config-web/CHANGELOG.md index f484572a86e60..13b0a6a7f2232 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config-web/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config-web/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config-web/pom.xml b/sdk/spring/spring-cloud-azure-appconfiguration-config-web/pom.xml index 666c112cf8e99..fdba157b3685c 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config-web/pom.xml +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config-web/pom.xml @@ -10,7 +10,7 @@ com.azure.spring spring-cloud-azure-appconfiguration-config-web - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure App Configuration Config Web Integration of Spring Cloud Config and Azure App Configuration Service @@ -24,7 +24,7 @@ com.azure.spring spring-cloud-azure-appconfiguration-config - 4.17.0-beta.1 + 4.18.0-beta.1 org.springframework.boot diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/CHANGELOG.md b/sdk/spring/spring-cloud-azure-appconfiguration-config/CHANGELOG.md index 6e37801830497..da680e820d805 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml b/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml index 664c56c765c03..c78a5175d1b6d 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml @@ -9,7 +9,7 @@ 4.0.0 com.azure.spring spring-cloud-azure-appconfiguration-config - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure App Configuration Config Integration of Spring Cloud Config and Azure App Configuration Service @@ -63,12 +63,12 @@ com.azure.spring spring-cloud-azure-service - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-autoconfigure - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/CHANGELOG.md b/sdk/spring/spring-cloud-azure-autoconfigure/CHANGELOG.md index d343c5f53303c..465a0ceac20d1 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-autoconfigure/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml b/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml index adc1e661f958f..4f65b9601b629 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml +++ b/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-autoconfigure - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure AutoConfigure Spring Cloud Azure AutoConfigure @@ -37,20 +37,20 @@ com.azure.spring spring-cloud-azure-service - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-resourcemanager - 4.17.0-beta.1 + 4.18.0-beta.1 true com.azure.spring spring-cloud-azure-trace-sleuth - 4.17.0-beta.1 + 4.18.0-beta.1 true @@ -59,7 +59,7 @@ com.azure.spring spring-integration-azure-eventhubs - 4.17.0-beta.1 + 4.18.0-beta.1 true @@ -73,7 +73,7 @@ com.azure.spring spring-integration-azure-servicebus - 4.17.0-beta.1 + 4.18.0-beta.1 true @@ -81,7 +81,7 @@ com.azure.spring spring-integration-azure-storage-queue - 4.17.0-beta.1 + 4.18.0-beta.1 true @@ -111,7 +111,7 @@ com.azure azure-spring-data-cosmos - 3.44.0-beta.1 + 3.45.0-beta.1 true diff --git a/sdk/spring/spring-cloud-azure-core/CHANGELOG.md b/sdk/spring/spring-cloud-azure-core/CHANGELOG.md index d343c5f53303c..465a0ceac20d1 100644 --- a/sdk/spring/spring-cloud-azure-core/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-core/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-core/pom.xml b/sdk/spring/spring-cloud-azure-core/pom.xml index fe308b408dccf..d07e74e1bbd5a 100644 --- a/sdk/spring/spring-cloud-azure-core/pom.xml +++ b/sdk/spring/spring-cloud-azure-core/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-core - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Core https://microsoft.github.io/spring-cloud-azure diff --git a/sdk/spring/spring-cloud-azure-feature-management-web/CHANGELOG.md b/sdk/spring/spring-cloud-azure-feature-management-web/CHANGELOG.md index 41efd12e4994d..cb045c6fcbc4b 100644 --- a/sdk/spring/spring-cloud-azure-feature-management-web/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-feature-management-web/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-feature-management-web/pom.xml b/sdk/spring/spring-cloud-azure-feature-management-web/pom.xml index 7dbdc930f0d65..a343a16d59861 100644 --- a/sdk/spring/spring-cloud-azure-feature-management-web/pom.xml +++ b/sdk/spring/spring-cloud-azure-feature-management-web/pom.xml @@ -9,7 +9,7 @@ com.azure.spring spring-cloud-azure-feature-management-web - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Feature Management Web Adds Feature Management into Spring Web @@ -46,7 +46,7 @@ com.azure.spring spring-cloud-azure-feature-management - 4.17.0-beta.1 + 4.18.0-beta.1 org.springframework.boot @@ -65,7 +65,7 @@ - com.azure.spring:spring-cloud-azure-feature-management:[4.17.0-beta.1] + com.azure.spring:spring-cloud-azure-feature-management:[4.18.0-beta.1] javax.servlet:javax.servlet-api:[4.0.1] org.springframework:spring-web:[5.3.32] org.springframework:spring-webmvc:[5.3.32] diff --git a/sdk/spring/spring-cloud-azure-feature-management/CHANGELOG.md b/sdk/spring/spring-cloud-azure-feature-management/CHANGELOG.md index eca601fb378aa..1473db8045d9d 100644 --- a/sdk/spring/spring-cloud-azure-feature-management/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-feature-management/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-feature-management/pom.xml b/sdk/spring/spring-cloud-azure-feature-management/pom.xml index 760b0e351161a..aaa69cd08983d 100644 --- a/sdk/spring/spring-cloud-azure-feature-management/pom.xml +++ b/sdk/spring/spring-cloud-azure-feature-management/pom.xml @@ -11,7 +11,7 @@ com.azure.spring spring-cloud-azure-feature-management - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Feature Management Adds Feature Management into Spring diff --git a/sdk/spring/spring-cloud-azure-integration-test-appconfiguration-config/pom.xml b/sdk/spring/spring-cloud-azure-integration-test-appconfiguration-config/pom.xml index 31ed7f1f59276..caf82424a10a2 100644 --- a/sdk/spring/spring-cloud-azure-integration-test-appconfiguration-config/pom.xml +++ b/sdk/spring/spring-cloud-azure-integration-test-appconfiguration-config/pom.xml @@ -24,7 +24,7 @@ com.azure.spring spring-cloud-azure-starter-appconfiguration-config - 4.17.0-beta.1 + 4.18.0-beta.1 org.springframework.boot diff --git a/sdk/spring/spring-cloud-azure-integration-tests/pom.xml b/sdk/spring/spring-cloud-azure-integration-tests/pom.xml index 8420d84237710..bbc9aa26b26b9 100644 --- a/sdk/spring/spring-cloud-azure-integration-tests/pom.xml +++ b/sdk/spring/spring-cloud-azure-integration-tests/pom.xml @@ -40,72 +40,72 @@ com.azure.spring spring-cloud-azure-starter-servicebus - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-starter-servicebus-jms - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-starter-eventhubs - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-starter-keyvault-secrets - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-starter-storage-blob - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-starter-storage-file-share - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-starter-storage-queue - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-starter-appconfiguration - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-starter-data-cosmos - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-starter-cosmos - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-stream-binder-eventhubs - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-stream-binder-servicebus - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-starter-jdbc-mysql - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-starter-redis - 4.17.0-beta.1 + 4.18.0-beta.1 org.springframework.boot diff --git a/sdk/spring/spring-cloud-azure-resourcemanager/CHANGELOG.md b/sdk/spring/spring-cloud-azure-resourcemanager/CHANGELOG.md index d343c5f53303c..465a0ceac20d1 100644 --- a/sdk/spring/spring-cloud-azure-resourcemanager/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-resourcemanager/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-resourcemanager/pom.xml b/sdk/spring/spring-cloud-azure-resourcemanager/pom.xml index e97dae470df32..0d57057a4bfcb 100644 --- a/sdk/spring/spring-cloud-azure-resourcemanager/pom.xml +++ b/sdk/spring/spring-cloud-azure-resourcemanager/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-resourcemanager - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Resource Manager Spring Cloud Azure Resource Manager @@ -37,7 +37,7 @@ com.azure.spring spring-cloud-azure-core - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-service/CHANGELOG.md b/sdk/spring/spring-cloud-azure-service/CHANGELOG.md index d6a301223a47e..69bda720e930f 100644 --- a/sdk/spring/spring-cloud-azure-service/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-service/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-service/pom.xml b/sdk/spring/spring-cloud-azure-service/pom.xml index d29d691f96687..1bf69fe0d5083 100644 --- a/sdk/spring/spring-cloud-azure-service/pom.xml +++ b/sdk/spring/spring-cloud-azure-service/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-service - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Service Spring Cloud Azure Service @@ -37,7 +37,7 @@ com.azure.spring spring-cloud-azure-core - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-active-directory-b2c/pom.xml b/sdk/spring/spring-cloud-azure-starter-active-directory-b2c/pom.xml index 6afa792c8f13d..83626bb180783 100644 --- a/sdk/spring/spring-cloud-azure-starter-active-directory-b2c/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-active-directory-b2c/pom.xml @@ -7,7 +7,7 @@ com.azure.spring spring-cloud-azure-starter-active-directory-b2c - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Active Directory B2C Spring Cloud Azure Starter Active Directory B2C @@ -87,7 +87,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 org.springframework.security diff --git a/sdk/spring/spring-cloud-azure-starter-active-directory/pom.xml b/sdk/spring/spring-cloud-azure-starter-active-directory/pom.xml index 6a51ef5ab0f3a..635ee00443206 100644 --- a/sdk/spring/spring-cloud-azure-starter-active-directory/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-active-directory/pom.xml @@ -7,7 +7,7 @@ com.azure.spring spring-cloud-azure-starter-active-directory - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Active Directory Spring Cloud Azure Starter Active Directory @@ -86,7 +86,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 org.springframework.security diff --git a/sdk/spring/spring-cloud-azure-starter-actuator/pom.xml b/sdk/spring/spring-cloud-azure-starter-actuator/pom.xml index b57ea9a5227f3..53206ffa48bcb 100644 --- a/sdk/spring/spring-cloud-azure-starter-actuator/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-actuator/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-actuator - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Actuator Spring Cloud Azure Starter Actuator @@ -88,12 +88,12 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-actuator-autoconfigure - 4.17.0-beta.1 + 4.18.0-beta.1 org.springframework.boot diff --git a/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/CHANGELOG.md b/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/CHANGELOG.md index 6dd58c40dde81..ccd45b9595385 100644 --- a/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/README.md b/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/README.md index 3a57c7cf79032..ab94a09b39458 100644 --- a/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/README.md +++ b/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/README.md @@ -21,7 +21,7 @@ There are two libraries that can be used spring-cloud-azure-appconfiguration-con com.azure.spring spring-cloud-azure-appconfiguration-config - 4.16.0 + 4.17.0 ``` [//]: # ({x-version-update-end}) @@ -33,7 +33,7 @@ or com.azure.spring spring-cloud-azure-appconfiguration-config-web - 4.16.0 + 4.17.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/pom.xml b/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/pom.xml index 496804e8dee9e..4eb4b796b0e95 100644 --- a/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-appconfiguration-config/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-starter-appconfiguration-config - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter App Configuration Config Spring Cloud Azure Starter App Configuration Config @@ -20,12 +20,12 @@ com.azure.spring spring-cloud-azure-appconfiguration-config-web - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-feature-management-web - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-appconfiguration/pom.xml b/sdk/spring/spring-cloud-azure-starter-appconfiguration/pom.xml index c8ff61e173272..b766f091e653e 100644 --- a/sdk/spring/spring-cloud-azure-starter-appconfiguration/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-appconfiguration/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-appconfiguration - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter App Configuration Spring Cloud Azure Starter App Configuration @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure diff --git a/sdk/spring/spring-cloud-azure-starter-cosmos/pom.xml b/sdk/spring/spring-cloud-azure-starter-cosmos/pom.xml index c48e7ff852117..27a0e3fcad6f8 100644 --- a/sdk/spring/spring-cloud-azure-starter-cosmos/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-cosmos/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-cosmos - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Cosmos DB Spring Cloud Azure Starter Cosmos DB @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure diff --git a/sdk/spring/spring-cloud-azure-starter-data-cosmos/pom.xml b/sdk/spring/spring-cloud-azure-starter-data-cosmos/pom.xml index 2ecfa1a1f26fd..2f110585ff5ee 100644 --- a/sdk/spring/spring-cloud-azure-starter-data-cosmos/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-data-cosmos/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-data-cosmos - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Data Cosmos DB Spring Cloud Azure Starter Data Cosmos DB @@ -88,12 +88,12 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure azure-spring-data-cosmos - 3.44.0-beta.1 + 3.45.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-eventgrid/pom.xml b/sdk/spring/spring-cloud-azure-starter-eventgrid/pom.xml index 3dcdb7c14cc4a..470d2dd7bbb9e 100644 --- a/sdk/spring/spring-cloud-azure-starter-eventgrid/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-eventgrid/pom.xml @@ -7,7 +7,7 @@ com.azure.spring spring-cloud-azure-starter-eventgrid - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Event Grid Spring Cloud Azure Starter Event Grid @@ -87,7 +87,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-eventhubs/pom.xml b/sdk/spring/spring-cloud-azure-starter-eventhubs/pom.xml index 85a9b42646f33..a108a1632246d 100644 --- a/sdk/spring/spring-cloud-azure-starter-eventhubs/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-eventhubs/pom.xml @@ -7,7 +7,7 @@ com.azure.spring spring-cloud-azure-starter-eventhubs - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Event Hubs Spring Cloud Azure Starter Event Hubs @@ -87,7 +87,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-integration-eventhubs/pom.xml b/sdk/spring/spring-cloud-azure-starter-integration-eventhubs/pom.xml index f69a1eb1cbee1..a8a02406ba15a 100644 --- a/sdk/spring/spring-cloud-azure-starter-integration-eventhubs/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-integration-eventhubs/pom.xml @@ -7,7 +7,7 @@ com.azure.spring spring-cloud-azure-starter-integration-eventhubs - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Integration Event Hubs Spring Cloud Azure Starter Integration Event Hubs @@ -87,7 +87,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 org.springframework.boot @@ -97,7 +97,7 @@ com.azure.spring spring-integration-azure-eventhubs - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-integration-servicebus/pom.xml b/sdk/spring/spring-cloud-azure-starter-integration-servicebus/pom.xml index d65a44f22e709..8ebc191f64f58 100644 --- a/sdk/spring/spring-cloud-azure-starter-integration-servicebus/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-integration-servicebus/pom.xml @@ -7,7 +7,7 @@ com.azure.spring spring-cloud-azure-starter-integration-servicebus - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Integration Service Bus Spring Cloud Azure Starter Integration Service Bus @@ -89,7 +89,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 org.springframework.boot @@ -99,7 +99,7 @@ com.azure.spring spring-integration-azure-servicebus - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-integration-storage-queue/pom.xml b/sdk/spring/spring-cloud-azure-starter-integration-storage-queue/pom.xml index 41e07f6efeae8..dbe37126226db 100644 --- a/sdk/spring/spring-cloud-azure-starter-integration-storage-queue/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-integration-storage-queue/pom.xml @@ -10,7 +10,7 @@ com.azure.spring spring-cloud-azure-starter-integration-storage-queue - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Integration Storage Queue Spring Cloud Azure Starter Integration Storage Queue @@ -92,7 +92,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 org.springframework.boot @@ -102,7 +102,7 @@ com.azure.spring spring-integration-azure-storage-queue - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-jdbc-mysql/pom.xml b/sdk/spring/spring-cloud-azure-starter-jdbc-mysql/pom.xml index 6c98c8dadd009..8c1242249ccd1 100644 --- a/sdk/spring/spring-cloud-azure-starter-jdbc-mysql/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-jdbc-mysql/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-jdbc-mysql - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter JDBC MySQL Spring Cloud Azure Starter for building applications with JDBC and Azure MySQL Services. Support authenticating with Azure AD. @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-jdbc-postgresql/pom.xml b/sdk/spring/spring-cloud-azure-starter-jdbc-postgresql/pom.xml index 5c889a1422b3f..8a0d5e801b5d9 100644 --- a/sdk/spring/spring-cloud-azure-starter-jdbc-postgresql/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-jdbc-postgresql/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-jdbc-postgresql - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter JDBC PostgreSQL Spring Cloud Azure Starter for building applications with JDBC and Azure PostgreSQL Services. Support authenticating with Azure AD. @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-keyvault-certificates/pom.xml b/sdk/spring/spring-cloud-azure-starter-keyvault-certificates/pom.xml index 87871dae72e1d..3e68268e9598d 100644 --- a/sdk/spring/spring-cloud-azure-starter-keyvault-certificates/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-keyvault-certificates/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-keyvault-certificates - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Key Vault Certificates Spring Cloud Azure Starter Key Vault Certificates @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure diff --git a/sdk/spring/spring-cloud-azure-starter-keyvault-secrets/pom.xml b/sdk/spring/spring-cloud-azure-starter-keyvault-secrets/pom.xml index 96ffef3b6f344..61f156c298d1c 100644 --- a/sdk/spring/spring-cloud-azure-starter-keyvault-secrets/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-keyvault-secrets/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-keyvault-secrets - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Key Vault Secrets Spring Cloud Azure Starter Key Vault Secrets @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure diff --git a/sdk/spring/spring-cloud-azure-starter-keyvault/pom.xml b/sdk/spring/spring-cloud-azure-starter-keyvault/pom.xml index ef9526fc84514..413fd6f3642c6 100644 --- a/sdk/spring/spring-cloud-azure-starter-keyvault/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-keyvault/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-keyvault - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Key Vault Spring Cloud Azure Starter Key Vault @@ -88,12 +88,12 @@ com.azure.spring spring-cloud-azure-starter-keyvault-secrets - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-starter-keyvault-certificates - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-redis/pom.xml b/sdk/spring/spring-cloud-azure-starter-redis/pom.xml index 2f6828ee57853..fe53a24296197 100644 --- a/sdk/spring/spring-cloud-azure-starter-redis/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-redis/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-redis - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Redis Spring Cloud Azure Starter for building applications with Azure Cache for Redis. Support authenticating with Azure AD. @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml b/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml index ce3f5e8e4820c..2e1a20aa01a3c 100644 --- a/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-servicebus-jms - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Service Bus JMS Spring Cloud Azure Starter Service Bus JMS @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-servicebus/pom.xml b/sdk/spring/spring-cloud-azure-starter-servicebus/pom.xml index 34e69d6b4c191..d6b175d5cb1cf 100644 --- a/sdk/spring/spring-cloud-azure-starter-servicebus/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-servicebus/pom.xml @@ -7,7 +7,7 @@ com.azure.spring spring-cloud-azure-starter-servicebus - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Service Bus Spring Cloud Azure Starter Service Bus @@ -89,7 +89,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure diff --git a/sdk/spring/spring-cloud-azure-starter-storage-blob/pom.xml b/sdk/spring/spring-cloud-azure-starter-storage-blob/pom.xml index 7f6d0b751d788..a6161f1221d0a 100644 --- a/sdk/spring/spring-cloud-azure-starter-storage-blob/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-storage-blob/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-storage-blob - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Storage Blob Spring Cloud Azure Starter Storage Blob @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-storage-file-share/pom.xml b/sdk/spring/spring-cloud-azure-starter-storage-file-share/pom.xml index da96bd9a2b9d9..fbda36ac89304 100644 --- a/sdk/spring/spring-cloud-azure-starter-storage-file-share/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-storage-file-share/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-storage-file-share - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Storage File Share Spring Cloud Azure Starter Storage File Share @@ -88,7 +88,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-storage-queue/pom.xml b/sdk/spring/spring-cloud-azure-starter-storage-queue/pom.xml index 0b02e0aeaa9da..468c70c8936be 100644 --- a/sdk/spring/spring-cloud-azure-starter-storage-queue/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-storage-queue/pom.xml @@ -10,7 +10,7 @@ com.azure.spring spring-cloud-azure-starter-storage-queue - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Storage Queue Spring Cloud Azure Starter Storage Queue @@ -92,7 +92,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure diff --git a/sdk/spring/spring-cloud-azure-starter-storage/pom.xml b/sdk/spring/spring-cloud-azure-starter-storage/pom.xml index 3b93c8ccda0c5..30656f50a0d9e 100644 --- a/sdk/spring/spring-cloud-azure-starter-storage/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-storage/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter-storage - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Storage Spring Cloud Azure Starter Storage @@ -88,19 +88,19 @@ com.azure.spring spring-cloud-azure-starter-storage-blob - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-starter-storage-file-share - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-starter-storage-queue - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-stream-eventhubs/pom.xml b/sdk/spring/spring-cloud-azure-starter-stream-eventhubs/pom.xml index dc3ebd44a400c..93c1c343f14e8 100644 --- a/sdk/spring/spring-cloud-azure-starter-stream-eventhubs/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-stream-eventhubs/pom.xml @@ -7,7 +7,7 @@ com.azure.spring spring-cloud-azure-starter-stream-eventhubs - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Stream Event Hubs Spring Cloud Azure Starter Stream Event Hubs @@ -87,7 +87,7 @@ com.azure.spring spring-cloud-azure-stream-binder-eventhubs - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter-stream-servicebus/pom.xml b/sdk/spring/spring-cloud-azure-starter-stream-servicebus/pom.xml index 50c213c9f2026..4dfd7bc5cbe2c 100644 --- a/sdk/spring/spring-cloud-azure-starter-stream-servicebus/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-stream-servicebus/pom.xml @@ -7,7 +7,7 @@ com.azure.spring spring-cloud-azure-starter-stream-servicebus - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Stream Service Bus Spring Cloud Azure Starter Stream Service Bus @@ -87,7 +87,7 @@ com.azure.spring spring-cloud-azure-stream-binder-servicebus - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-starter/pom.xml b/sdk/spring/spring-cloud-azure-starter/pom.xml index f66629f944fa0..49ea91767701d 100644 --- a/sdk/spring/spring-cloud-azure-starter/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter/pom.xml @@ -6,7 +6,7 @@ com.azure.spring spring-cloud-azure-starter - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Starter Core starter, including auto-configuration support @@ -93,7 +93,7 @@ com.azure.spring spring-cloud-azure-autoconfigure - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/CHANGELOG.md b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/CHANGELOG.md index d343c5f53303c..465a0ceac20d1 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/pom.xml b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/pom.xml index 59222bcfb4dc1..f12e67613b3d1 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/pom.xml +++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-stream-binder-eventhubs-core - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Stream Binder Event Hubs Core Spring Cloud Azure Stream Binder Event Hubs Core @@ -49,7 +49,7 @@ com.azure.spring spring-integration-azure-eventhubs - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/CHANGELOG.md b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/CHANGELOG.md index d343c5f53303c..465a0ceac20d1 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/pom.xml b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/pom.xml index 747ce10a3a2b7..ca1095a16a163 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/pom.xml +++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-stream-binder-eventhubs - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Stream Binder Event Hubs Spring Cloud Azure Stream Binder Event Hubs @@ -37,12 +37,12 @@ com.azure.spring spring-cloud-azure-autoconfigure - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-stream-binder-eventhubs-core - 4.17.0-beta.1 + 4.18.0-beta.1 @@ -60,7 +60,7 @@ com.azure.spring spring-cloud-azure-resourcemanager - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/CHANGELOG.md b/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/CHANGELOG.md index d6a301223a47e..69bda720e930f 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/pom.xml b/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/pom.xml index 30362749c0992..1a19a40301b7d 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/pom.xml +++ b/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-stream-binder-servicebus-core - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Stream Binder Service Bus Core Spring Cloud Azure Stream Binder Service Bus Core @@ -43,7 +43,7 @@ com.azure.spring spring-integration-azure-servicebus - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure diff --git a/sdk/spring/spring-cloud-azure-stream-binder-servicebus/CHANGELOG.md b/sdk/spring/spring-cloud-azure-stream-binder-servicebus/CHANGELOG.md index d6a301223a47e..69bda720e930f 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-servicebus/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-stream-binder-servicebus/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-stream-binder-servicebus/pom.xml b/sdk/spring/spring-cloud-azure-stream-binder-servicebus/pom.xml index 8c913181a79f5..21f4f44bf00d7 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-servicebus/pom.xml +++ b/sdk/spring/spring-cloud-azure-stream-binder-servicebus/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-stream-binder-servicebus - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Stream Binder Service Bus Spring Cloud Azure Stream Binder Service Bus @@ -37,17 +37,17 @@ com.azure.spring spring-cloud-azure-stream-binder-servicebus-core - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-autoconfigure - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-cloud-azure-resourcemanager - 4.17.0-beta.1 + 4.18.0-beta.1 org.springframework.boot diff --git a/sdk/spring/spring-cloud-azure-trace-sleuth/CHANGELOG.md b/sdk/spring/spring-cloud-azure-trace-sleuth/CHANGELOG.md index d343c5f53303c..465a0ceac20d1 100644 --- a/sdk/spring/spring-cloud-azure-trace-sleuth/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-trace-sleuth/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-cloud-azure-trace-sleuth/pom.xml b/sdk/spring/spring-cloud-azure-trace-sleuth/pom.xml index 91b1078da727f..8f44c8ac4c137 100644 --- a/sdk/spring/spring-cloud-azure-trace-sleuth/pom.xml +++ b/sdk/spring/spring-cloud-azure-trace-sleuth/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-cloud-azure-trace-sleuth - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Cloud Azure Trace on Sleuth https://microsoft.github.io/spring-cloud-azure @@ -36,7 +36,7 @@ com.azure.spring spring-cloud-azure-core - 4.17.0-beta.1 + 4.18.0-beta.1 org.springframework.cloud diff --git a/sdk/spring/spring-integration-azure-core/CHANGELOG.md b/sdk/spring/spring-integration-azure-core/CHANGELOG.md index d6a301223a47e..69bda720e930f 100644 --- a/sdk/spring/spring-integration-azure-core/CHANGELOG.md +++ b/sdk/spring/spring-integration-azure-core/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-integration-azure-core/pom.xml b/sdk/spring/spring-integration-azure-core/pom.xml index 942700519cef3..f8aa3316ab0a9 100644 --- a/sdk/spring/spring-integration-azure-core/pom.xml +++ b/sdk/spring/spring-integration-azure-core/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-integration-azure-core - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Integration Azure Core Spring Integration Azure Core @@ -41,7 +41,7 @@ com.azure.spring spring-messaging-azure - 4.17.0-beta.1 + 4.18.0-beta.1 org.springframework.integration diff --git a/sdk/spring/spring-integration-azure-eventhubs/CHANGELOG.md b/sdk/spring/spring-integration-azure-eventhubs/CHANGELOG.md index d343c5f53303c..465a0ceac20d1 100644 --- a/sdk/spring/spring-integration-azure-eventhubs/CHANGELOG.md +++ b/sdk/spring/spring-integration-azure-eventhubs/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-integration-azure-eventhubs/pom.xml b/sdk/spring/spring-integration-azure-eventhubs/pom.xml index 7d92ec385634d..a7f2b73145137 100644 --- a/sdk/spring/spring-integration-azure-eventhubs/pom.xml +++ b/sdk/spring/spring-integration-azure-eventhubs/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-integration-azure-eventhubs - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Integration Azure Event Hubs Spring Integration Azure Event Hubs @@ -37,19 +37,19 @@ com.azure.spring spring-integration-azure-core - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-integration-azure-core - 4.17.0-beta.1 + 4.18.0-beta.1 test-jar test com.azure.spring spring-messaging-azure-eventhubs - 4.17.0-beta.1 + 4.18.0-beta.1 diff --git a/sdk/spring/spring-integration-azure-servicebus/CHANGELOG.md b/sdk/spring/spring-integration-azure-servicebus/CHANGELOG.md index d6a301223a47e..69bda720e930f 100644 --- a/sdk/spring/spring-integration-azure-servicebus/CHANGELOG.md +++ b/sdk/spring/spring-integration-azure-servicebus/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-integration-azure-servicebus/pom.xml b/sdk/spring/spring-integration-azure-servicebus/pom.xml index 24f3c701da65a..0625f9f534889 100644 --- a/sdk/spring/spring-integration-azure-servicebus/pom.xml +++ b/sdk/spring/spring-integration-azure-servicebus/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-integration-azure-servicebus - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Integration Azure Service Bus Spring Integration Azure Service Bus @@ -37,24 +37,24 @@ com.azure.spring spring-integration-azure-core - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-integration-azure-core - 4.17.0-beta.1 + 4.18.0-beta.1 test-jar test com.azure.spring spring-messaging-azure-servicebus - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-messaging-azure-servicebus - 4.17.0-beta.1 + 4.18.0-beta.1 test-jar test diff --git a/sdk/spring/spring-integration-azure-storage-queue/CHANGELOG.md b/sdk/spring/spring-integration-azure-storage-queue/CHANGELOG.md index d6a301223a47e..69bda720e930f 100644 --- a/sdk/spring/spring-integration-azure-storage-queue/CHANGELOG.md +++ b/sdk/spring/spring-integration-azure-storage-queue/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-integration-azure-storage-queue/pom.xml b/sdk/spring/spring-integration-azure-storage-queue/pom.xml index b47df64df5d6c..597cf0165620d 100644 --- a/sdk/spring/spring-integration-azure-storage-queue/pom.xml +++ b/sdk/spring/spring-integration-azure-storage-queue/pom.xml @@ -13,7 +13,7 @@ com.azure.spring spring-integration-azure-storage-queue - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Integration Azure Storage Queue Spring Integration Azure Storage Queue @@ -38,12 +38,12 @@ com.azure.spring spring-integration-azure-core - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-messaging-azure-storage-queue - 4.17.0-beta.1 + 4.18.0-beta.1 + 4.18.0-beta.1 Spring Messaging Azure Event Hubs Spring Messaging Azure Event Hubs @@ -37,12 +37,12 @@ com.azure.spring spring-messaging-azure - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-messaging-azure - 4.17.0-beta.1 + 4.18.0-beta.1 test-jar test diff --git a/sdk/spring/spring-messaging-azure-servicebus/CHANGELOG.md b/sdk/spring/spring-messaging-azure-servicebus/CHANGELOG.md index d343c5f53303c..465a0ceac20d1 100644 --- a/sdk/spring/spring-messaging-azure-servicebus/CHANGELOG.md +++ b/sdk/spring/spring-messaging-azure-servicebus/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-messaging-azure-servicebus/pom.xml b/sdk/spring/spring-messaging-azure-servicebus/pom.xml index 87a26bfe373fd..9ea3fd4669455 100644 --- a/sdk/spring/spring-messaging-azure-servicebus/pom.xml +++ b/sdk/spring/spring-messaging-azure-servicebus/pom.xml @@ -13,7 +13,7 @@ com.azure.spring spring-messaging-azure-servicebus - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Messaging Azure Service Bus Spring Messaging Azure Service Bus @@ -38,12 +38,12 @@ com.azure.spring spring-messaging-azure - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-messaging-azure - 4.17.0-beta.1 + 4.18.0-beta.1 test-jar test diff --git a/sdk/spring/spring-messaging-azure-storage-queue/CHANGELOG.md b/sdk/spring/spring-messaging-azure-storage-queue/CHANGELOG.md index d6a301223a47e..69bda720e930f 100644 --- a/sdk/spring/spring-messaging-azure-storage-queue/CHANGELOG.md +++ b/sdk/spring/spring-messaging-azure-storage-queue/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-messaging-azure-storage-queue/pom.xml b/sdk/spring/spring-messaging-azure-storage-queue/pom.xml index 22ecf86f3e1d6..c28ec6a9875e3 100644 --- a/sdk/spring/spring-messaging-azure-storage-queue/pom.xml +++ b/sdk/spring/spring-messaging-azure-storage-queue/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-messaging-azure-storage-queue - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Messaging Azure Storage Queue Spring Messaging Azure Storage Queue @@ -37,12 +37,12 @@ com.azure.spring spring-messaging-azure - 4.17.0-beta.1 + 4.18.0-beta.1 com.azure.spring spring-messaging-azure - 4.17.0-beta.1 + 4.18.0-beta.1 test-jar test diff --git a/sdk/spring/spring-messaging-azure/CHANGELOG.md b/sdk/spring/spring-messaging-azure/CHANGELOG.md index d343c5f53303c..465a0ceac20d1 100644 --- a/sdk/spring/spring-messaging-azure/CHANGELOG.md +++ b/sdk/spring/spring-messaging-azure/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 4.17.0-beta.1 (Unreleased) +## 4.18.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,10 @@ ### Other Changes +## 4.17.0 (2024-03-28) + +Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4170-2024-03-28) for more details. + ## 4.16.0 (2024-02-28) Please refer to [spring/CHANGELOG.md](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/CHANGELOG.md#4160-2024-02-28) for more details. diff --git a/sdk/spring/spring-messaging-azure/pom.xml b/sdk/spring/spring-messaging-azure/pom.xml index c1900f6970716..7c63f841b0a68 100644 --- a/sdk/spring/spring-messaging-azure/pom.xml +++ b/sdk/spring/spring-messaging-azure/pom.xml @@ -12,7 +12,7 @@ com.azure.spring spring-messaging-azure - 4.17.0-beta.1 + 4.18.0-beta.1 Spring Messaging Azure Spring Messaging Azure @@ -37,7 +37,7 @@ com.azure.spring spring-cloud-azure-service - 4.17.0-beta.1 + 4.18.0-beta.1 org.springframework diff --git a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileAsyncApiTests.java b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileAsyncApiTests.java index e7849a90023c8..6e13cb172eda4 100644 --- a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileAsyncApiTests.java +++ b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileAsyncApiTests.java @@ -2640,8 +2640,9 @@ public void appendDataLeaseAutoRenew() { DataLakeFileAppendOptions appendOptions = new DataLakeFileAppendOptions() .setLeaseAction(LeaseAction.AUTO_RENEW) .setLeaseId(r.getT3()); - return Mono.zip(r.getT2().appendWithResponse(DATA.getDefaultBinaryData(), 0, appendOptions), r.getT2().getProperties()); - }); + return Mono.zip(r.getT2().appendWithResponse(DATA.getDefaultBinaryData(), 0, appendOptions), + Mono.just(r.getT2())); + }).flatMap(tuple -> Mono.zip(Mono.just(tuple.getT1()), tuple.getT2().getProperties())); StepVerifier.create(response) .assertNext(r -> { @@ -2668,9 +2669,11 @@ public void appendDataLeaseRelease() { Mono> response1 = leaseClient.acquireLease(15) .then(r.appendWithResponse(DATA.getDefaultBinaryData(), 0, appendOptions)); - Mono response2 = r.getProperties(); - - return Mono.zip(response1, response2); + return Mono.zip(response1, Mono.just(r)); + }) + .flatMap(tuple -> { + Mono response2 = tuple.getT2().getProperties(); + return Mono.zip(Mono.just(tuple.getT1()), response2); }); StepVerifier.create(response) diff --git a/sdk/synapse/azure-analytics-synapse-accesscontrol/pom.xml b/sdk/synapse/azure-analytics-synapse-accesscontrol/pom.xml index 66715517c8554..f4d8a384d4186 100644 --- a/sdk/synapse/azure-analytics-synapse-accesscontrol/pom.xml +++ b/sdk/synapse/azure-analytics-synapse-accesscontrol/pom.xml @@ -62,6 +62,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + org.junit.jupiter junit-jupiter-api @@ -87,4 +93,20 @@ test + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/synapse/azure-analytics-synapse-artifacts/pom.xml b/sdk/synapse/azure-analytics-synapse-artifacts/pom.xml index f23d7978fbfbd..f8196a4b3de6b 100644 --- a/sdk/synapse/azure-analytics-synapse-artifacts/pom.xml +++ b/sdk/synapse/azure-analytics-synapse-artifacts/pom.xml @@ -62,6 +62,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + org.junit.jupiter junit-jupiter-api @@ -87,4 +93,20 @@ test + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/pom.xml b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/pom.xml index 3f8acf37e0c2f..d3b534d9f351b 100644 --- a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/pom.xml +++ b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/pom.xml @@ -62,6 +62,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + org.junit.jupiter junit-jupiter-api @@ -87,4 +93,20 @@ test + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/synapse/azure-analytics-synapse-monitoring/pom.xml b/sdk/synapse/azure-analytics-synapse-monitoring/pom.xml index b75484d9d3df0..74a1985fc4fc1 100644 --- a/sdk/synapse/azure-analytics-synapse-monitoring/pom.xml +++ b/sdk/synapse/azure-analytics-synapse-monitoring/pom.xml @@ -62,6 +62,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + org.junit.jupiter junit-jupiter-api @@ -87,4 +93,20 @@ test + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/synapse/azure-analytics-synapse-spark/pom.xml b/sdk/synapse/azure-analytics-synapse-spark/pom.xml index e2d982bfcadc7..a3513bcc4f941 100644 --- a/sdk/synapse/azure-analytics-synapse-spark/pom.xml +++ b/sdk/synapse/azure-analytics-synapse-spark/pom.xml @@ -68,6 +68,12 @@ 1.11.19 test + + com.azure + azure-core-http-vertx + 1.0.0-beta.16 + test + org.junit.jupiter junit-jupiter-api @@ -93,4 +99,20 @@ test + + + java12plus + + [12,) + + + + com.azure + azure-core-http-jdk-httpclient + 1.0.0-beta.11 + test + + + + diff --git a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableClient.java b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableClient.java index e1656181ab773..c1ba28dbe0c8d 100644 --- a/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableClient.java +++ b/sdk/tables/azure-data-tables/src/main/java/com/azure/data/tables/TableClient.java @@ -159,7 +159,7 @@ * *

  *
- * TableEntity myTableEntity = new TableEntity("paritionKey", "rowKey")
+ * TableEntity myTableEntity = new TableEntity("partitionKey", "rowKey")
  *     .addProperty("Property", "Value");
  *
  * tableClient.updateEntity(myTableEntity, TableEntityUpdateMode.REPLACE);
@@ -772,7 +772,7 @@ public void updateEntity(TableEntity entity) {
      * 
      * 
      *
-     * TableEntity myTableEntity = new TableEntity("paritionKey", "rowKey")
+     * TableEntity myTableEntity = new TableEntity("partitionKey", "rowKey")
      *     .addProperty("Property", "Value");
      *
      * tableClient.updateEntity(myTableEntity, TableEntityUpdateMode.REPLACE);
diff --git a/sdk/tables/azure-data-tables/src/samples/java/com/azure/data/tables/codesnippets/TableClientJavaDocCodeSnippets.java b/sdk/tables/azure-data-tables/src/samples/java/com/azure/data/tables/codesnippets/TableClientJavaDocCodeSnippets.java
index 9cd3361d99bbe..82c26689281a6 100644
--- a/sdk/tables/azure-data-tables/src/samples/java/com/azure/data/tables/codesnippets/TableClientJavaDocCodeSnippets.java
+++ b/sdk/tables/azure-data-tables/src/samples/java/com/azure/data/tables/codesnippets/TableClientJavaDocCodeSnippets.java
@@ -185,7 +185,7 @@ public void updateEntity() {
 
         // BEGIN: com.azure.data.tables.tableClient.updateEntity#TableEntity-TableEntityUpdateMode
 
-        TableEntity myTableEntity = new TableEntity("paritionKey", "rowKey")
+        TableEntity myTableEntity = new TableEntity("partitionKey", "rowKey")
             .addProperty("Property", "Value");
 
         tableClient.updateEntity(myTableEntity, TableEntityUpdateMode.REPLACE);